Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Commit

Permalink
Merge pull request #120 from andreruffert/release-0.3.9
Browse files Browse the repository at this point in the history
Release 0.3.9
  • Loading branch information
andreruffert committed Jan 30, 2015
2 parents ab6292a + b032a7d commit 6a467de
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 47 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,11 @@ language: node_js
node_js:
- '0.10'
before_install: npm install -g grunt-cli

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/99705e6a67a76bccdad5
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#rangeslider.js [![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) [![rangeslider.js](http://img.shields.io/badge/rangeslider-.js-00ff00.svg)](http://andreruffert.github.io/rangeslider.js/) [![Build Status](https://travis-ci.org/andreruffert/rangeslider.js.svg?branch=develop)](https://travis-ci.org/andreruffert/rangeslider.js)
#rangeslider.js
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) [![rangeslider.js](http://img.shields.io/badge/rangeslider-.js-00ff00.svg)](http://andreruffert.github.io/rangeslider.js/) [![Build Status](https://travis-ci.org/andreruffert/rangeslider.js.svg?branch=develop)](https://travis-ci.org/andreruffert/rangeslider.js) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/andreruffert/rangeslider.js)

>Simple, small and fast JavaScript/jQuery polyfill for the HTML5 `<input type="range">` slider element.
Check out the [examples](http://andreruffert.github.io/rangeslider.js/).

* Touchscreen friendly
Expand All @@ -25,7 +26,7 @@ Install with [npm](https://www.npmjs.org/):
$('input[type="range"]').rangeslider();
```

Check out the [website's section](http://andreruffert.github.io/rangeslider.js/#usage) for further informations on how to use rangeslider.js.
For more informations check out the [website's section](http://andreruffert.github.io/rangeslider.js/#usage). For support visit the [gitter room](https://gitter.im/andreruffert/rangeslider.js).


## License
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rangeslider.js",
"version": "0.3.8",
"version": "0.3.9",
"homepage": "https://github.com/andreruffert/rangeslider.js",
"authors": [
"André Ruffert <[email protected]>"
Expand Down
32 changes: 12 additions & 20 deletions dist/rangeslider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! rangeslider.js - v0.3.8 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
/*! rangeslider.js - v0.3.9 | (c) 2015 @andreruffert | MIT license | https://github.com/andreruffert/rangeslider.js */
(function(factory) {
'use strict';

Expand Down Expand Up @@ -27,7 +27,6 @@
}

var pluginName = 'rangeslider',
pluginInstances = [],
pluginIdentifier = 0,
inputrange = supportsRange(),
defaults = {
Expand Down Expand Up @@ -166,11 +165,6 @@
this.$document = $(document);
this.$element = $(element);
this.options = $.extend( {}, defaults, options );
this._defaults = defaults;
this._name = pluginName;
this.startEvent = this.options.startEvent.join('.' + pluginName + ' ') + '.' + pluginName;
this.moveEvent = this.options.moveEvent.join('.' + pluginName + ' ') + '.' + pluginName;
this.endEvent = this.options.endEvent.join('.' + pluginName + ' ') + '.' + pluginName;
this.polyfill = this.options.polyfill;
this.onInit = this.options.onInit;
this.onSlide = this.options.onSlide;
Expand All @@ -183,6 +177,9 @@
}

this.identifier = 'js-' + pluginName + '-' +(pluginIdentifier++);
this.startEvent = this.options.startEvent.join('.' + this.identifier + ' ') + '.' + this.identifier;
this.moveEvent = this.options.moveEvent.join('.' + this.identifier + ' ') + '.' + this.identifier;
this.endEvent = this.options.endEvent.join('.' + this.identifier + ' ') + '.' + this.identifier;
this.min = parseFloat(this.$element[0].getAttribute('min') || 0);
this.max = parseFloat(this.$element[0].getAttribute('max') || 100);
this.value = parseFloat(this.$element[0].value || this.min + (this.max-this.min)/2);
Expand Down Expand Up @@ -210,16 +207,16 @@

// Attach Events
var _this = this;
this.$window.on('resize' + '.' + pluginName, debounce(function() {
this.$window.on('resize' + '.' + this.identifier, debounce(function() {
// Simulate resizeEnd event.
delay(function() { _this.update(); }, 300);
}, 20));

this.$document.on(this.startEvent, '#' + this.identifier + ':not(.' + this.options.disabledClass + ')', this.handleDown);

// Listen to programmatic value changes
this.$element.on('change' + '.' + pluginName, function(e, data) {
if (data && data.origin === pluginName) {
this.$element.on('change' + '.' + this.identifier, function(e, data) {
if (data && data.origin === _this.identifier) {
return;
}

Expand Down Expand Up @@ -364,27 +361,23 @@

Plugin.prototype.setValue = function(value) {
if (value !== this.value) {
this.$element.val(value).trigger('change', {origin: pluginName});
this.$element.val(value).trigger('change', {origin: this.identifier});
}
};

Plugin.prototype.destroy = function() {
this.$document.off(this.startEvent, '#' + this.identifier, this.handleDown);
this.$document.off('.' + this.identifier);
this.$window.off('.' + this.identifier);

this.$element
.off('.' + pluginName)
.off('.' + this.identifier)
.removeAttr('style')
.removeData('plugin_' + pluginName);

// Remove the generated markup
if (this.$range && this.$range.length) {
this.$range[0].parentNode.removeChild(this.$range[0]);
}

// Remove global events if there isn't any instance anymore.
pluginInstances.splice(pluginInstances.indexOf(this.$element[0]),1);
if (!pluginInstances.length) {
this.$window.off('.' + pluginName);
}
};

// A really lightweight plugin wrapper around the constructor,
Expand All @@ -397,7 +390,6 @@
// Create a new instance.
if (!data) {
$this.data('plugin_' + pluginName, (data = new Plugin(this, options)));
pluginInstances.push(this);
}

// Make it possible to access methods from public.
Expand Down
4 changes: 2 additions & 2 deletions dist/rangeslider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "rangeslider.js",
"title": "rangeslider.js",
"description": "Simple, small and fast JavaScript/jQuery polyfill for the HTML5 <input type=\"range\"> slider element",
"version": "0.3.8",
"codename": "Mauvelous",
"version": "0.3.9",
"codename": "Periwinkle",
"main": "dist/rangeslider.js",
"homepage": "https://github.com/andreruffert/rangeslider.js",
"author": {
Expand Down
Loading

0 comments on commit 6a467de

Please sign in to comment.