<commit_before>(function() {
  'use strict';

  $(document).ready(function() {
    var
      scrollElements,
      inValidRange,
      setVisibility,
      setVisibilityAll,
      resetScroll;

    scrollElements = $('[data-scroll-element]');

    inValidRange = function(offset, limit) {
      return offset >= 0 && offset < limit;
    };

    setVisibility = function(element, nextOffset, limit) {
      if(inValidRange(nextOffset, limit)) {
        element.removeClass('disabled');
      } else {
        element.addClass('disabled');
      }
    };

    setVisibilityAll = function(elements, newOffset) {
      var
        $this,
        increment,
        nextOffset,
        limit;

      elements.each(function() {
        $this      = $(this);
        increment  = $this.data('scroll-increment');
        nextOffset = newOffset + increment;
        limit      = $this.data('scroll-limit');

        setVisibility($this, nextOffset, limit);
      });
    };

    resetScroll = function(element) {
      element[0].scrollTop = 0;
      element.data('scroll-offset', 0);
    };

    $('[data-clipboard-target]').each(function() {
      var
          clipboard,
          notification;

      clipboard = new Clipboard(this);

      var notifySuccess = function(e) {
          //set notification text to Copied!
          notification = $($(e.trigger.dataset.clipboardNotification));
          notification.value("Copied!");
          notification.addClass('in').delay(1400).queue(function() {
              notification.removeClass('in');
              $(this).dequeue();
          })
      };

        var notifyFailure = function(e) {
            //set notification text to Press Ctrl+C to copy
            notification = $($(e.trigger.dataset.clipboardNotification));
            notification.value("Press Ctrl+C to copy");
            notification.addClass('in').delay(1400).queue(function() {
                notification.removeClass('in');
                $(this).dequeue();
            })
        };

      clipboard.on('success', notifySuccess);
      clipboard.on('error', notifyFailure);<commit_msg>MR cleaned up copy notification code<commit_after>(function() {
  'use strict';

  $(document).ready(function() {
    var
      scrollElements,
      inValidRange,
      setVisibility,
      setVisibilityAll,
      resetScroll;

    scrollElements = $('[data-scroll-element]');

    inValidRange = function(offset, limit) {
      return offset >= 0 && offset < limit;
    };

    setVisibility = function(element, nextOffset, limit) {
      if(inValidRange(nextOffset, limit)) {
        element.removeClass('disabled');
      } else {
        element.addClass('disabled');
      }
    };

    setVisibilityAll = function(elements, newOffset) {
      var
        $this,
        increment,
        nextOffset,
        limit;

      elements.each(function() {
        $this      = $(this);
        increment  = $this.data('scroll-increment');
        nextOffset = newOffset + increment;
        limit      = $this.data('scroll-limit');

        setVisibility($this, nextOffset, limit);
      });
    };

    resetScroll = function(element) {
      element[0].scrollTop = 0;
      element.data('scroll-offset', 0);
    };

    $('[data-clipboard-target]').each(function() {
      var
          clipboard,
          notification;

      clipboard = new Clipboard(this);

      var notify = function(clipboardNotification, notificationText) {
          notification = $($(clipboardNotification));
          notification.text(notificationText);
          notification.addClass('in').delay(1400).queue(function() {
              notification.removeClass('in');
              $(this).dequeue();
          })
      };

      var notifySuccess = function(e) {
          //set notification text to Copied!
          notify(e.trigger.dataset.clipboardNotification, "Copied!");
          /* notification = $($());
          notification.text("Copied!");
          notification.addClass('in').delay(1400).queue(function() {
              notification.removeClass('in');
              $(this).dequeue();
          }) */
      };

        var notifyFailure = function(e) {
            //set notification text to Press Ctrl+C to copy
            notify(e.trigger.dataset.clipboardNotification, "Press Ctrl+C to copy");
            /* notification = $($(e.trigger.dataset.clipboardNotification));
            notification.text("Press Ctrl+C to copy");
            notification.addClass('in').delay(1400).queue(function() {
                notification.removeClass('in');
                $(this).dequeue();
            }) */
        };

      clipboard.on('success', notifySuccess);
      clipboard.on('error', notifyFailure);
{'fraction_non_alphanumeric': 0.13898305084745763, 'fraction_numerical': 0.005932203389830509, 'mean_word_length': 2.170584284754869, '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': '1177909', 'n_tokens_mistral': 1263, 'n_tokens_neox': 1215, 'n_words': 222}