Sha256: 0954b0ef2d55344df961e76cf0ba3eda30c2a2768ffaf54afea596fadbbd3239

Contents?: true

Size: 721 Bytes

Versions: 13

Compression:

Stored size: 721 Bytes

Contents

// takes a string and parses into an integer, but throws away commas first, to avoid truncation when there is a comma
// use in place of javascript's native parseInt
!function(global) {
  'use strict';

  var previousBlacklightRangeLimit = global.BlacklightRangeLimit;

  function BlacklightRangeLimit(options) {
    this.options = options || {};
  }

  BlacklightRangeLimit.parseNum = function parseNum(str) {
    str = String(str).replace(/[^0-9-]/g, '');
    return parseInt(str, 10);
  };

  BlacklightRangeLimit.noConflict = function noConflict() {
    global.BlacklightRangeLimit = previousBlacklightRangeLimit;
    return BlacklightRangeLimit;
  };

  global.BlacklightRangeLimit = BlacklightRangeLimit;
}(this);

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
blacklight_range_limit-7.9.1 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.9.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.8.2 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.8.1 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.8.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.7.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.6.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.5.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.4.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.3.2 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.3.1 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.3.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js
blacklight_range_limit-7.2.0 app/assets/javascripts/blacklight_range_limit/range_limit_shared.js