<commit_before>/*!
 * Range Slider
 *
 * jQuery UI widget for selecting a range. This is an optimized version of the
 * range option for the slider widget built into jQuery UI.
 *
 * Adapted from jQuery UI Slider:
 *   jQuery UI Slider @VERSION
 *   http://jqueryui.com
 *
 *   Copyright 2012 jQuery Foundation and other contributors
 *   Released under the MIT license.
 *   http://jquery.org/license
 *
 *   http://api.jqueryui.com/slider/
 *
 *   Depends:
 *  	jquery.ui.core.js
 *  	jquery.ui.mouse.js
 *  	jquery.ui.widget.js
 */
(function($, undefined) {

// number of pages in a slider
// (how many times can you page up/down to go through the whole range)
var numPages = 5;

$.widget("ui.rangeslider", $.ui.mouse, {
  version: "@VERSION",
  widgetEventPrefix: "rangeslide",

  options: {
    animate: false,
    distance: 0,
    max: 100,
    min: 0,
    orientation: "horizontal",
    step: 1,
    values: null,
  },

  _create: function() {
    var i, handleCount,
        o = this.options,
        existingHandles = this.element.find(".ui-slider-handle").
            addClass("ui-state-default ui-corner-all"),
        handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' " +
            "href='#'></a>",
        handles = [];

    this._keySliding = false;
    this._mouseSliding = false;
    this._animateOff = true;
    this._handleIndex = null;
    this._detectOrientation();
    this._mouseInit();

    this.element
        .addClass(
          "ui-slider" +
          " ui-slider-" + this.orientation +
          " ui-widget" +
          " ui-widget-content" +
          " ui-corner-all"
        );

    if (!o.values) {
      o.values = [this._valueMin(), this._valueMin()];
    };
    if (o.values.length && o.values.length !== 2) {
      o.values = [o.values[0], o.values[0]];
    };

    this.range = $("<div></div>")
        .appendTo(this.element)
        .addClass(
          "ui-slider-range" +
          // note: this isn't the most fittingly semantic framework class
          // for this element, but worked best visually with a variety of
          // themes
          " ui-widget-header"
        );

    handleCount = 2;

    for (i = existingHandles.length; i < handleCount; i++) {
      handles.push(handle);
    };

    this.handles = existingHandles.add($(handles.join(""))
        .appendTo(this.element));

    this.handle = this.handles.eq(0);

    this.handles.add(this.range).filter("a")
        .click(function(event) {
          event.preventDefault();
        })
        .mouseenter(function() {
          if (!o.disabled) {
            $(this).addClass("ui-state-hover");
          };
        })
        .mouseleave(function() {
          $(this).removeClass("ui-state-hover");
        })
        .focus(function() {
          if (!o.disabled) {
            $(".ui-slider .ui-state-focus").removeClass("ui-state-focus");
            $(this).addClass("ui-state-focus");
          } else {
            $(this).blur();
          };
        })
        .blur(function() {
          $(this).removeClass("ui-state-focus");
        });

    this.handles.each(function(i) {
      $(this).data("ui-slider-handle-index", i);
    });

    this._setOption("disabled", o.disabled);

    this._on(this.handles, {
      keydown: function(event) {<commit_msg>rangeSlider: change handle tags from `a` to `div`<commit_after>/*!
 * Range Slider
 *
 * jQuery UI widget for selecting a range. This is an optimized version of the
 * range option for the slider widget built into jQuery UI.
 *
 * Adapted from jQuery UI Slider:
 *   jQuery UI Slider @VERSION
 *   http://jqueryui.com
 *
 *   Copyright 2012 jQuery Foundation and other contributors
 *   Released under the MIT license.
 *   http://jquery.org/license
 *
 *   http://api.jqueryui.com/slider/
 *
 *   Depends:
 *  	jquery.ui.core.js
 *  	jquery.ui.mouse.js
 *  	jquery.ui.widget.js
 */
(function($, undefined) {

// number of pages in a slider
// (how many times can you page up/down to go through the whole range)
var numPages = 5;

$.widget("ui.rangeslider", $.ui.mouse, {
  version: "@VERSION",
  widgetEventPrefix: "rangeslide",

  options: {
    animate: false,
    distance: 0,
    max: 100,
    min: 0,
    orientation: "horizontal",
    step: 1,
    values: null,
  },

  _create: function() {
    var i, handleCount,
        o = this.options,
        existingHandles = this.element.find(".ui-slider-handle").
            addClass("ui-state-default ui-corner-all"),
        handle = "<div class='ui-slider-handle ui-state-default " +
            "ui-corner-all'></div>",
        handles = [];

    this._keySliding = false;
    this._mouseSliding = false;
    this._animateOff = true;
    this._handleIndex = null;
    this._detectOrientation();
    this._mouseInit();

    this.element
        .addClass(
          "ui-slider" +
          " ui-slider-" + this.orientation +
          " ui-widget" +
          " ui-widget-content" +
          " ui-corner-all"
        );

    if (!o.values) {
      o.values = [this._valueMin(), this._valueMin()];
    };
    if (o.values.length && o.values.length !== 2) {
      o.values = [o.values[0], o.values[0]];
    };

    this.range = $("<div></div>")
        .appendTo(this.element)
        .addClass(
          "ui-slider-range" +
          // note: this isn't the most fittingly semantic framework class
          // for this element, but worked best visually with a variety of
          // themes
          " ui-widget-header"
        );

    handleCount = 2;

    for (i = existingHandles.length; i < handleCount; i++) {
      handles.push(handle);
    };

    this.handles = existingHandles.add($(handles.join(""))
        .appendTo(this.element));

    this.handle = this.handles.eq(0);

    this.handles.add(this.range).filter(".ui-slider-handle")
        .click(function(event) {
          event.preventDefault();
        })
        .mouseenter(function() {
          if (!o.disabled) {
            $(this).addClass("ui-state-hover");
          };
        })
        .mouseleave(function() {
          $(this).removeClass("ui-state-hover");
        })
        .focus(function() {
          if (!o.disabled) {
            $(".ui-slider .ui-state-focus").removeClass("ui-state-focus");
            $(this).addClass("ui-state-focus");
          } else {
            $(this).blur();
          };
        })
        .blur(function() {
          $(this).removeClass("ui-state-focus");
        });

    this.handles.each(function(i) {
      $(this).data("ui-slider-handle-index", i);
    });

    this._setOption("disabled", o.disabled);

    this._on(this.handles, {
      keydown: function(event) {
{'fraction_non_alphanumeric': 0.15726958352127499, 'fraction_numerical': 0.0048113065704405355, 'mean_word_length': 2.054178145087236, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '5280552', 'n_tokens_mistral': 2118, 'n_tokens_neox': 2039, 'n_words': 438}