<commit_before>(function($) {
  'use strict'; 
  $.fn.extend({
    ////////////////////////////
    // Initialize Deletable List
    // Directly on the list
    ////////////////////////////
    UIDeletable : function ( options ) {
      /*
        options = {
          list: selector,
          editLabel : labelName || Edit,
          doneLabel : labelName || Done,
          deleteLabel : labelName || Delete,
          placement: left || right,
          callback : callback
        }
      */
      // Cache a reference to the list:
      var $this = this;
      // If no options, do nothing:
      if (!options) {
        return;
      }
      // If a list was provided, 
      // do older initialization:
      if (options && options.list) {
        return $.UIDeletable(options);
      // Otherwise pass in reference to list
      // and initialize with it:
      } else if (options && !options.list) {
        $.extend(options, {
          list: $this
        });
        return $.UIDeletable(options);
      }
    }
  });

  $.extend({
    ////////////////////////////
    // Initialize Deletable List
    ////////////////////////////
    UIDeletable : function ( options ) {
      /*
        options = {
          list: selector,
          editLabel : labelName || Edit,
          doneLabel : labelName || Done,
          deleteLabel : labelName || Delete,
          placement: left || right,
          callback : callback
        }
      */
      if (!options || !options.list || !options instanceof Array) {
        return;
      }
      var list = $(options.list);
      var editLabel = options.editLabel || 'Edit';
      var doneLabel = options.doneLabel || 'Done';
      var deleteLabel = options.deleteLabel || 'Delete';
      var placement = options.placement || 'right';
      var callback = options.callback || $.noop;
      var deleteButton;
      var editButton;
      var deletionIndicator;
      var button;
      var dispelDeletable = 'swiperight';
      var enableDeletable = 'swipeleft';
      var dir = $('html').attr('dir');
      dir = dir ? dir.toLowerCase() : '';
      if (dir === 'rtl') {
        dispelDeletable = 'swipeleft';
        enableDeletable = 'swiperight';
      }
      // Windows uses an icon for the delete button:
      if ($.isWin) deleteLabel = '';
      var height = $('li').eq(1)[0].clientHeight;
      deleteButton = $.concat('<a href="javascript:void(null)" class="button delete">', deleteLabel, '</a>');
      editButton = $.concat('<a href="javascript:void(null)" class="button edit">', editLabel, '</a>');
      deletionIndicator = '<span class="deletion-indicator"></span>';
      if (placement === 'left') {
        if (!list[0].classList.contains('deletable')) {
          list.closest('article').prev().prepend(editButton);
        }
      } else {
        if (!list[0].classList.contains('deletable')) {
          list.closest('article').prev().append(editButton);
          list.closest('article').prev().find('h1').addClass('buttonOnRight');
          list.closest('article').prev().find('.edit').addClass('align-flush');
          button = list.closest('article').prev().find('.edit');
        }
      }
      list.find('li').each(function(_, ctx) {
        if (!$(ctx).has('.deletion-indicator')[0]) {
          $(ctx).prepend(deletionIndicator);
          $(ctx).append(deleteButton);
        }
      });
      list.addClass('deletable');
      var setupDeletability = function(callback, list, button) {
        var deleteSlide;
        if ($.isiOS) {
          deleteSlide = '100px';
        } else if ($.isAndroid) {
          deleteSlide = '140px';
        }
        $(function() {
          button.on('singletap', function() {
            var $this = this;
            if (this.classList.contains('edit')) {
              setTimeout(function() {
                $this.classList.remove('edit');
                $this.classList.add('done');
                $($this).text(doneLabel);
                $(list).addClass('showIndicators');
              });
            } else if (this.classList.contains('done')) {
              setTimeout(function() {
                $this.classList.remove('done');
                $this.classList.add('edit');
                $($this).text(editLabel);<commit_msg>Removed unused variable form UIDeletable.<commit_after>(function($) {
  'use strict'; 
  $.fn.extend({
    ////////////////////////////
    // Initialize Deletable List
    // Directly on the list
    ////////////////////////////
    UIDeletable : function ( options ) {
      /*
        options = {
          list: selector,
          editLabel : labelName || Edit,
          doneLabel : labelName || Done,
          deleteLabel : labelName || Delete,
          placement: left || right,
          callback : callback
        }
      */
      // Cache a reference to the list:
      var $this = this;
      // If no options, do nothing:
      if (!options) {
        return;
      }
      // If a list was provided, 
      // do older initialization:
      if (options && options.list) {
        return $.UIDeletable(options);
      // Otherwise pass in reference to list
      // and initialize with it:
      } else if (options && !options.list) {
        $.extend(options, {
          list: $this
        });
        return $.UIDeletable(options);
      }
    }
  });

  $.extend({
    ////////////////////////////
    // Initialize Deletable List
    ////////////////////////////
    UIDeletable : function ( options ) {
      /*
        options = {
          list: selector,
          editLabel : labelName || Edit,
          doneLabel : labelName || Done,
          deleteLabel : labelName || Delete,
          placement: left || right,
          callback : callback
        }
      */
      if (!options || !options.list || !options instanceof Array) {
        return;
      }
      var list = $(options.list);
      var editLabel = options.editLabel || 'Edit';
      var doneLabel = options.doneLabel || 'Done';
      var deleteLabel = options.deleteLabel || 'Delete';
      var placement = options.placement || 'right';
      var callback = options.callback || $.noop;
      var deleteButton;
      var editButton;
      var deletionIndicator;
      var button;
      var dispelDeletable = 'swiperight';
      var enableDeletable = 'swipeleft';
      var dir = $('html').attr('dir');
      dir = dir ? dir.toLowerCase() : '';
      if (dir === 'rtl') {
        dispelDeletable = 'swipeleft';
        enableDeletable = 'swiperight';
      }
      // Windows uses an icon for the delete button:
      if ($.isWin) deleteLabel = '';
      var height = $('li').eq(1)[0].clientHeight;
      deleteButton = $.concat('<a href="javascript:void(null)" class="button delete">', deleteLabel, '</a>');
      editButton = $.concat('<a href="javascript:void(null)" class="button edit">', editLabel, '</a>');
      deletionIndicator = '<span class="deletion-indicator"></span>';
      if (placement === 'left') {
        if (!list[0].classList.contains('deletable')) {
          list.closest('article').prev().prepend(editButton);
        }
      } else {
        if (!list[0].classList.contains('deletable')) {
          list.closest('article').prev().append(editButton);
          list.closest('article').prev().find('h1').addClass('buttonOnRight');
          list.closest('article').prev().find('.edit').addClass('align-flush');
          button = list.closest('article').prev().find('.edit');
        }
      }
      list.find('li').each(function(_, ctx) {
        if (!$(ctx).has('.deletion-indicator')[0]) {
          $(ctx).prepend(deletionIndicator);
          $(ctx).append(deleteButton);
        }
      });
      list.addClass('deletable');
      var setupDeletability = function(callback, list, button) {
        $(function() {
          button.on('singletap', function() {
            var $this = this;
            if (this.classList.contains('edit')) {
              setTimeout(function() {
                $this.classList.remove('edit');
                $this.classList.add('done');
                $($this).text(doneLabel);
                $(list).addClass('showIndicators');
              });
            } else if (this.classList.contains('done')) {
              setTimeout(function() {
                $this.classList.remove('done');
                $this.classList.add('edit');
                $($this).text(editLabel);
{'fraction_non_alphanumeric': 0.1773809523809524, 'fraction_numerical': 0.002142857142857143, 'mean_word_length': 1.8162923231645993, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3188356', 'n_tokens_mistral': 2280, 'n_tokens_neox': 2261, 'n_words': 490}