diff --git a/js/simple-slider.coffee b/js/simple-slider.coffee deleted file mode 100644 index 10ef9d4..0000000 --- a/js/simple-slider.coffee +++ /dev/null @@ -1,361 +0,0 @@ -### - jQuery Simple Slider - - Copyright (c) 2012 James Smith (http://loopj.com) - - Licensed under the MIT license (http://mit-license.org/) -### - -(($, window) -> - - # - # Main slider class - # - - class SimpleSlider - # Build a slider object. - # Exposed via el.numericalSlider(options) - constructor: (@input, options) -> - # Load in the settings - @defaultOptions = - animate: true - snapMid: false - classPrefix: null - classSuffix: null - theme: null - highlight: false - - @settings = $.extend({}, @defaultOptions, options) - @settings.classSuffix = "-#{@settings.theme}" if @settings.theme - - # Hide the original input - @input.hide() - - # Create the slider canvas - @slider = $("
") - .addClass("slider"+(@settings.classSuffix || "")) - .css - position: "relative" - userSelect: "none" - boxSizing: "border-box" - .insertBefore @input - @slider.attr("id", @input.attr("id") + "-slider") if @input.attr("id") - - @track = @createDivElement("track") - .css - width: "100%" - - if @settings.highlight - # Create the highlighting track on top of the track - @highlightTrack = @createDivElement("highlight-track") - .css - width: "0" - - # Create the slider drag target - @dragger = @createDivElement("dragger") - - # Adjust dimensions now elements are in the DOM - @slider.css - minHeight: @dragger.outerHeight() - marginLeft: @dragger.outerWidth()/2 - marginRight: @dragger.outerWidth()/2 - - @track.css - marginTop: @track.outerHeight()/-2 - - if @settings.highlight - @highlightTrack.css - marginTop: @track.outerHeight()/-2 - - @dragger.css - marginTop: @dragger.outerHeight()/-2 - marginLeft: @dragger.outerWidth()/-2 - - # Hook up drag/drop mouse events - @track - .mousedown (e) => - @trackEvent(e) - - if @settings.highlight - @highlightTrack - .mousedown (e) => - @trackEvent(e) - - @dragger - .mousedown (e) => - return unless e.which == 1 - - # We've started moving - @dragging = true - @dragger.addClass "dragging" - - # Update the slider position - @domDrag(e.pageX, e.pageY) - - false - - $("body") - .mousemove (e) => - if @dragging - # Update the slider position - @domDrag(e.pageX, e.pageY) - - # Always show a pointer when dragging - $("body").css cursor: "pointer" - - - .mouseup (e) => - if @dragging - # Finished dragging - @dragging = false - @dragger.removeClass "dragging" - - # Revert the cursor - $("body").css cursor: "auto" - - # Set slider initial position - @pagePos = 0 - - # Fill in initial slider value - if @input.val() == "" - @value = @getRange().min - @input.val(@value) - else - @value = @nearestValidValue(@input.val()) - - @setSliderPositionFromValue(@value) - - # We are ready to go - ratio = @valueToRatio(@value) - @input.trigger "slider:ready", - value: @value - ratio: ratio - position: ratio * @slider.outerWidth() - el: @slider - - # Create the basis of the track-div(s) - createDivElement: (classname) -> - item = $("
") - .addClass(classname) - .css - position: "absolute" - top: "50%" - userSelect: "none" - cursor: "pointer" - .appendTo @slider - return item - - - # Set the ratio (value between 0 and 1) of the slider. - # Exposed via el.slider("setRatio", ratio) - setRatio: (ratio) -> - # Range-check the ratio - ratio = Math.min(1, ratio) - ratio = Math.max(0, ratio) - - # Work out the value - value = @ratioToValue(ratio) - - # Update the position of the slider on the screen - @setSliderPositionFromValue(value) - - # Trigger value changed events - @valueChanged(value, ratio, "setRatio") - - # Set the value of the slider - # Exposed via el.slider("setValue", value) - setValue: (value) -> - # Snap value to nearest step or allowedValue - value = @nearestValidValue(value) - - # Work out the ratio - ratio = @valueToRatio(value) - - # Update the position of the slider on the screen - @setSliderPositionFromValue(value) - - # Trigger value changed events - @valueChanged(value, ratio, "setValue") - - # Respond to an event on a track - trackEvent: (e) -> - return unless e.which == 1 - - @domDrag(e.pageX, e.pageY, true) - @dragging = true - false - - # Respond to a dom drag event - domDrag: (pageX, pageY, animate=false) -> - # Normalize position within allowed range - pagePos = pageX - @slider.offset().left - pagePos = Math.min(@slider.outerWidth(), pagePos) - pagePos = Math.max(0, pagePos) - - # If the element position has changed, do stuff - if @pagePos != pagePos - @pagePos = pagePos - - # Set the percentage value of the slider - ratio = pagePos / @slider.outerWidth() - - # Trigger value changed events - value = @ratioToValue(ratio) - @valueChanged(value, ratio, "domDrag") - - # Update the position of the slider on the screen - if @settings.snap - @setSliderPositionFromValue(value, animate) - else - @setSliderPosition(pagePos, animate) - - # Set the slider position given a slider canvas position - setSliderPosition: (position, animate=false) -> - if animate and @settings.animate - @dragger.animate left: position, 200 - @highlightTrack.animate width: position, 200 if @settings.highlight - else - @dragger.css left: position - @highlightTrack.css width: position if @settings.highlight - - # Set the slider position given a value - setSliderPositionFromValue: (value, animate=false) -> - # Get the slide ratio from the value - ratio = @valueToRatio(value) - - # Set the slider position - @setSliderPosition(ratio * @slider.outerWidth(), animate) - - # Get the valid range of values - getRange: -> - if @settings.allowedValues - min: Math.min(@settings.allowedValues...) - max: Math.max(@settings.allowedValues...) - else if @settings.range - min: parseFloat(@settings.range[0]) - max: parseFloat(@settings.range[1]) - else - min: 0 - max: 1 - - # Find the nearest valid value, checking allowedValues and step settings - nearestValidValue: (rawValue) -> - range = @getRange() - - # Range-check the value - rawValue = Math.min(range.max, rawValue) - rawValue = Math.max(range.min, rawValue) - - # Apply allowedValues or step settings - if @settings.allowedValues - closest = null - $.each @settings.allowedValues, -> - if closest == null || Math.abs(this - rawValue) < Math.abs(closest - rawValue) - closest = this - - return closest - else if @settings.step - maxSteps = (range.max - range.min) / @settings.step - steps = Math.floor((rawValue - range.min) / @settings.step) - steps += 1 if (rawValue - range.min) % @settings.step > @settings.step / 2 and steps < maxSteps - - return steps * @settings.step + range.min - else - return rawValue - - # Convert a value to a ratio - valueToRatio: (value) -> - if @settings.equalSteps - # Get slider ratio for equal-step - for allowedVal, idx in @settings.allowedValues - if !closest? || Math.abs(allowedVal - value) < Math.abs(closest - value) - closest = allowedVal - closestIdx = idx - - if @settings.snapMid - (closestIdx+0.5)/@settings.allowedValues.length - else - (closestIdx)/(@settings.allowedValues.length - 1) - - else - # Get slider ratio for continuous values - range = @getRange() - (value - range.min) / (range.max - range.min) - - # Convert a ratio to a valid value - ratioToValue: (ratio) -> - if @settings.equalSteps - steps = @settings.allowedValues.length - step = Math.round(ratio * steps - 0.5) - idx = Math.min(step, @settings.allowedValues.length - 1) - - @settings.allowedValues[idx] - else - range = @getRange() - rawValue = ratio * (range.max - range.min) + range.min - - @nearestValidValue(rawValue) - - # Trigger value changed events - valueChanged: (value, ratio, trigger) -> - return if value.toString() == @value.toString() - - # Save the new value - @value = value - - # Construct event data and fire event - eventData = - value: value - ratio: ratio - position: ratio * @slider.outerWidth() - trigger: trigger - el: @slider - - @input - .val(value) - .trigger($.Event("change", eventData)) - .trigger("slider:changed", eventData) - - - # - # Expose as jQuery Plugin - # - - $.extend $.fn, simpleSlider: (settingsOrMethod, params...) -> - publicMethods = ["setRatio", "setValue"] - - $(this).each -> - if settingsOrMethod and settingsOrMethod in publicMethods - obj = $(this).data("slider-object") - - obj[settingsOrMethod].apply(obj, params) - else - settings = settingsOrMethod - $(this).data "slider-object", new SimpleSlider($(this), settings) - - - # - # Attach unobtrusive JS hooks - # - - $ -> - $("[data-slider]").each -> - $el = $(this) - - # Build options object from data attributes - settings = {} - - allowedValues = $el.data "slider-values" - settings.allowedValues = (parseFloat(x) for x in allowedValues.split(",")) if allowedValues - settings.range = $el.data("slider-range").split(",") if $el.data("slider-range") - settings.step = $el.data("slider-step") if $el.data("slider-step") - settings.snap = $el.data("slider-snap") - settings.equalSteps = $el.data("slider-equal-steps") - settings.theme = $el.data("slider-theme") if $el.data("slider-theme") - settings.highlight = $el.data("slider-highlight") if $el.attr("data-slider-highlight") - settings.animate = $el.data("slider-animate") if $el.data("slider-animate")? - - # Activate the plugin - $el.simpleSlider settings - -) @jQuery or @Zepto, this diff --git a/js/simple-slider.js b/js/simple-slider.js index 1a02e5b..a1fee1f 100644 --- a/js/simple-slider.js +++ b/js/simple-slider.js @@ -1,7 +1,10 @@ /* jQuery Simple Slider - Copyright (c) 2012 James Smith (http://loopj.com) + Copyright (c) 2012, 2013 James Smith (http://loopj.com) + Copyright (c) 2013 Maarten van Grootel (http://maatenvangrootel.nl) + Copyright (c) 2013 Nathan Hunzaker (http://natehunzaker.com) + Copyright (c) 2013 Erik J. Nedwidek (http://github.com/nedwidek) Licensed under the MIT license (http://mit-license.org/) */ @@ -23,8 +26,12 @@ var __slice = [].slice, classPrefix: null, classSuffix: null, theme: null, - highlight: false + highlight: false, + showScale: false }; + if(typeof options == 'undefined') { + options = this.loadDataOptions(); + } this.settings = $.extend({}, this.defaultOptions, options); if (this.settings.theme) { this.settings.classSuffix = "-" + this.settings.theme; @@ -73,7 +80,7 @@ var __slice = [].slice, }); } this.dragger.mousedown(function(e) { - if (e.which !== 1) { + if (e.which !== 1 || _this.settings.disabled) { return; } _this.dragging = true; @@ -106,6 +113,20 @@ var __slice = [].slice, } this.setSliderPositionFromValue(this.value); ratio = this.valueToRatio(this.value); + if (this.settings.showScale) { + this.scale = this.createDivElement("scale"); + this.minScale = this.createSpanElement("min-scale", this.scale); + this.maxScale = this.createSpanElement("max-scale", this.scale); + + range = this.getRange(); + + this.minScale.html(range.min); + this.maxScale.html(range.max); + + this.scale.css('marginTop', function(index, currentValue) { + return (parseInt(currentValue, 10) + this.previousSibling.offsetHeight / 2) + 'px'; + }); + } this.input.trigger("slider:ready", { value: this.value, ratio: ratio, @@ -114,6 +135,47 @@ var __slice = [].slice, }); } + SimpleSlider.prototype.loadDataOptions = function() { + var options = {}; + allowedValues = this.input.data("slider-values"); + if (allowedValues) { + options.allowedValues = (function() { + var _i, _len, _ref, _results; + _ref = allowedValues.split(","); + _results = []; + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + x = _ref[_i]; + _results.push(parseFloat(x)); + } + return _results; + })(); + } + if (this.input.data("slider-range")) { + options.range = this.input.data("slider-range").split(","); + } + if (this.input.data("slider-step")) { + options.step = this.input.data("slider-step"); + } + options.snap = this.input.data("slider-snap"); + options.equalSteps = this.input.data("slider-equal-steps"); + if (this.input.data("slider-theme")) { + options.theme = this.input.data("slider-theme"); + } + if (this.input.attr("data-slider-highlight")) { + options.highlight = this.input.data("slider-highlight"); + } + if (this.input.data("slider-animate") != null) { + options.animate = this.input.data("slider-animate"); + } + if (this.input.data("slider-showscale") != null) { + options.showScale = this.input.data("slider-showscale"); + } + if (this.input.data("slider-disabled")) { + options.disabled = this.input.data("slider-disabled"); + } + return options; + } + SimpleSlider.prototype.createDivElement = function(classname) { var item; item = $("
").addClass(classname).css({ @@ -125,6 +187,12 @@ var __slice = [].slice, return item; }; + SimpleSlider.prototype.createSpanElement = function(classname, parent) { + var item; + item = $("").addClass(classname).appendTo(parent); + return item; + }; + SimpleSlider.prototype.setRatio = function(ratio) { var value; ratio = Math.min(1, ratio); @@ -142,8 +210,12 @@ var __slice = [].slice, return this.valueChanged(value, ratio, "setValue"); }; + SimpleSlider.prototype.setDisabled = function(value) { + this.settings.disabled = value; + } + SimpleSlider.prototype.trackEvent = function(e) { - if (e.which !== 1) { + if (e.which !== 1 || this.settings.disabled) { return; } this.domDrag(e.pageX, e.pageY, true); @@ -309,7 +381,7 @@ var __slice = [].slice, simpleSlider: function() { var params, publicMethods, settingsOrMethod; settingsOrMethod = arguments[0], params = 2 <= arguments.length ? __slice.call(arguments, 1) : []; - publicMethods = ["setRatio", "setValue"]; + publicMethods = ["setRatio", "setValue", "setDisabled", ]; return $(this).each(function() { var obj, settings; if (settingsOrMethod && __indexOf.call(publicMethods, settingsOrMethod) >= 0) { @@ -322,42 +394,14 @@ var __slice = [].slice, }); } }); + + /* return $(function() { return $("[data-slider]").each(function() { var $el, allowedValues, settings, x; $el = $(this); - settings = {}; - allowedValues = $el.data("slider-values"); - if (allowedValues) { - settings.allowedValues = (function() { - var _i, _len, _ref, _results; - _ref = allowedValues.split(","); - _results = []; - for (_i = 0, _len = _ref.length; _i < _len; _i++) { - x = _ref[_i]; - _results.push(parseFloat(x)); - } - return _results; - })(); - } - if ($el.data("slider-range")) { - settings.range = $el.data("slider-range").split(","); - } - if ($el.data("slider-step")) { - settings.step = $el.data("slider-step"); - } - settings.snap = $el.data("slider-snap"); - settings.equalSteps = $el.data("slider-equal-steps"); - if ($el.data("slider-theme")) { - settings.theme = $el.data("slider-theme"); - } - if ($el.attr("data-slider-highlight")) { - settings.highlight = $el.data("slider-highlight"); - } - if ($el.data("slider-animate") != null) { - settings.animate = $el.data("slider-animate"); - } - return $el.simpleSlider(settings); + return $el.simpleSlider(); }); }); + */ })(this.jQuery || this.Zepto, this); diff --git a/js/simple-slider.min.js b/js/simple-slider.min.js index 9a03258..91fe583 100644 --- a/js/simple-slider.min.js +++ b/js/simple-slider.min.js @@ -8,4 +8,4 @@ * */ -var __slice=[].slice,__indexOf=[].indexOf||function(e){for(var t=0,n=this.length;t").addClass("slider"+(this.settings.classSuffix||"")).css({position:"relative",userSelect:"none",boxSizing:"border-box"}).insertBefore(this.input),this.input.attr("id")&&this.slider.attr("id",this.input.attr("id")+"-slider"),this.track=this.createDivElement("track").css({width:"100%"}),this.settings.highlight&&(this.highlightTrack=this.createDivElement("highlight-track").css({width:"0"})),this.dragger=this.createDivElement("dragger"),this.slider.css({minHeight:this.dragger.outerHeight(),marginLeft:this.dragger.outerWidth()/2,marginRight:this.dragger.outerWidth()/2}),this.track.css({marginTop:this.track.outerHeight()/-2}),this.settings.highlight&&this.highlightTrack.css({marginTop:this.track.outerHeight()/-2}),this.dragger.css({marginTop:this.dragger.outerHeight()/-2,marginLeft:this.dragger.outerWidth()/-2}),this.track.mousedown(function(e){return i.trackEvent(e)}),this.settings.highlight&&this.highlightTrack.mousedown(function(e){return i.trackEvent(e)}),this.dragger.mousedown(function(e){if(e.which!==1)return;return i.dragging=!0,i.dragger.addClass("dragging"),i.domDrag(e.pageX,e.pageY),!1}),e("body").mousemove(function(t){if(i.dragging)return i.domDrag(t.pageX,t.pageY),e("body").css({cursor:"pointer"})}).mouseup(function(t){if(i.dragging)return i.dragging=!1,i.dragger.removeClass("dragging"),e("body").css({cursor:"auto"})}),this.pagePos=0,this.input.val()===""?(this.value=this.getRange().min,this.input.val(this.value)):this.value=this.nearestValidValue(this.input.val()),this.setSliderPositionFromValue(this.value),r=this.valueToRatio(this.value),this.input.trigger("slider:ready",{value:this.value,ratio:r,position:r*this.slider.outerWidth(),el:this.slider})}return t.prototype.createDivElement=function(t){var n;return n=e("
").addClass(t).css({position:"absolute",top:"50%",userSelect:"none",cursor:"pointer"}).appendTo(this.slider),n},t.prototype.setRatio=function(e){var t;return e=Math.min(1,e),e=Math.max(0,e),t=this.ratioToValue(e),this.setSliderPositionFromValue(t),this.valueChanged(t,e,"setRatio")},t.prototype.setValue=function(e){var t;return e=this.nearestValidValue(e),t=this.valueToRatio(e),this.setSliderPositionFromValue(e),this.valueChanged(e,t,"setValue")},t.prototype.trackEvent=function(e){if(e.which!==1)return;return this.domDrag(e.pageX,e.pageY,!0),this.dragging=!0,!1},t.prototype.domDrag=function(e,t,n){var r,i,s;n==null&&(n=!1),r=e-this.slider.offset().left,r=Math.min(this.slider.outerWidth(),r),r=Math.max(0,r);if(this.pagePos!==r)return this.pagePos=r,i=r/this.slider.outerWidth(),s=this.ratioToValue(i),this.valueChanged(s,i,"domDrag"),this.settings.snap?this.setSliderPositionFromValue(s,n):this.setSliderPosition(r,n)},t.prototype.setSliderPosition=function(e,t){t==null&&(t=!1);if(t&&this.settings.animate){this.dragger.animate({left:e},200);if(this.settings.highlight)return this.highlightTrack.animate({width:e},200)}else{this.dragger.css({left:e});if(this.settings.highlight)return this.highlightTrack.css({width:e})}},t.prototype.setSliderPositionFromValue=function(e,t){var n;return t==null&&(t=!1),n=this.valueToRatio(e),this.setSliderPosition(n*this.slider.outerWidth(),t)},t.prototype.getRange=function(){return this.settings.allowedValues?{min:Math.min.apply(Math,this.settings.allowedValues),max:Math.max.apply(Math,this.settings.allowedValues)}:this.settings.range?{min:parseFloat(this.settings.range[0]),max:parseFloat(this.settings.range[1])}:{min:0,max:1}},t.prototype.nearestValidValue=function(t){var n,r,i,s;return i=this.getRange(),t=Math.min(i.max,t),t=Math.max(i.min,t),this.settings.allowedValues?(n=null,e.each(this.settings.allowedValues,function(){if(n===null||Math.abs(this-t)this.settings.step/2&&s=0?(s=e(this).data("slider-object"),s[i].apply(s,t)):(o=i,e(this).data("slider-object",new n(e(this),o)))})}}),e(function(){return e("[data-slider]").each(function(){var t,n,r,i;return t=e(this),r={},n=t.data("slider-values"),n&&(r.allowedValues=function(){var e,t,r,s;r=n.split(","),s=[];for(e=0,t=r.length;e").addClass("slider"+(this.settings.classSuffix||"")).css({position:"relative",userSelect:"none",boxSizing:"border-box"}).insertBefore(this.input),this.input.attr("id")&&this.slider.attr("id",this.input.attr("id")+"-slider"),this.track=this.createDivElement("track").css({width:"100%"}),this.settings.highlight&&(this.highlightTrack=this.createDivElement("highlight-track").css({width:"0"})),this.dragger=this.createDivElement("dragger"),this.slider.css({minHeight:this.dragger.outerHeight(),marginLeft:this.dragger.outerWidth()/2,marginRight:this.dragger.outerWidth()/2}),this.track.css({marginTop:this.track.outerHeight()/-2}),this.settings.highlight&&this.highlightTrack.css({marginTop:this.track.outerHeight()/-2}),this.dragger.css({marginTop:this.dragger.outerHeight()/-2,marginLeft:this.dragger.outerWidth()/-2}),this.track.mousedown(function(e){return i.trackEvent(e)}),this.settings.highlight&&this.highlightTrack.mousedown(function(e){return i.trackEvent(e)}),this.dragger.mousedown(function(e){if(e.which!==1||i.settings.disabled)return;return i.dragging=!0,i.dragger.addClass("dragging"),i.domDrag(e.pageX,e.pageY),!1}),e("body").mousemove(function(t){if(i.dragging)return i.domDrag(t.pageX,t.pageY),e("body").css({cursor:"pointer"})}).mouseup(function(t){if(i.dragging)return i.dragging=!1,i.dragger.removeClass("dragging"),e("body").css({cursor:"auto"})}),this.pagePos=0,this.input.val()===""?(this.value=this.getRange().min,this.input.val(this.value)):this.value=this.nearestValidValue(this.input.val()),this.setSliderPositionFromValue(this.value),r=this.valueToRatio(this.value),this.settings.showScale&&(this.scale=this.createDivElement("scale"),this.minScale=this.createSpanElement("min-scale",this.scale),this.maxScale=this.createSpanElement("max-scale",this.scale),range=this.getRange(),this.minScale.html(range.min),this.maxScale.html(range.max),this.scale.css("marginTop",function(e,t){return parseInt(t,10)+this.previousSibling.offsetHeight/2+"px"})),this.input.trigger("slider:ready",{value:this.value,ratio:r,position:r*this.slider.outerWidth(),el:this.slider})}return t.prototype.loadDataOptions=function(){var e={};return allowedValues=this.input.data("slider-values"),allowedValues&&(e.allowedValues=function(){var e,t,n,r;n=allowedValues.split(","),r=[];for(e=0,t=n.length;e").addClass(t).css({position:"absolute",top:"50%",userSelect:"none",cursor:"pointer"}).appendTo(this.slider),n},t.prototype.createSpanElement=function(t,n){var r;return r=e("").addClass(t).appendTo(n),r},t.prototype.setRatio=function(e){var t;return e=Math.min(1,e),e=Math.max(0,e),t=this.ratioToValue(e),this.setSliderPositionFromValue(t),this.valueChanged(t,e,"setRatio")},t.prototype.setValue=function(e){var t;return e=this.nearestValidValue(e),t=this.valueToRatio(e),this.setSliderPositionFromValue(e),this.valueChanged(e,t,"setValue")},t.prototype.setDisabled=function(e){this.settings.disabled=e},t.prototype.trackEvent=function(e){if(e.which!==1||this.settings.disabled)return;return this.domDrag(e.pageX,e.pageY,!0),this.dragging=!0,!1},t.prototype.domDrag=function(e,t,n){var r,i,s;n==null&&(n=!1),r=e-this.slider.offset().left,r=Math.min(this.slider.outerWidth(),r),r=Math.max(0,r);if(this.pagePos!==r)return this.pagePos=r,i=r/this.slider.outerWidth(),s=this.ratioToValue(i),this.valueChanged(s,i,"domDrag"),this.settings.snap?this.setSliderPositionFromValue(s,n):this.setSliderPosition(r,n)},t.prototype.setSliderPosition=function(e,t){t==null&&(t=!1);if(t&&this.settings.animate){this.dragger.animate({left:e},200);if(this.settings.highlight)return this.highlightTrack.animate({width:e},200)}else{this.dragger.css({left:e});if(this.settings.highlight)return this.highlightTrack.css({width:e})}},t.prototype.setSliderPositionFromValue=function(e,t){var n;return t==null&&(t=!1),n=this.valueToRatio(e),this.setSliderPosition(n*this.slider.outerWidth(),t)},t.prototype.getRange=function(){return this.settings.allowedValues?{min:Math.min.apply(Math,this.settings.allowedValues),max:Math.max.apply(Math,this.settings.allowedValues)}:this.settings.range?{min:parseFloat(this.settings.range[0]),max:parseFloat(this.settings.range[1])}:{min:0,max:1}},t.prototype.nearestValidValue=function(t){var n,r,i,s;return i=this.getRange(),t=Math.min(i.max,t),t=Math.max(i.min,t),this.settings.allowedValues?(n=null,e.each(this.settings.allowedValues,function(){if(n===null||Math.abs(this-t)this.settings.step/2&&s=0?(s=e(this).data("slider-object"),s[i].apply(s,t)):(o=i,e(this).data("slider-object",new n(e(this),o)))})}})})(this.jQuery||this.Zepto,this); \ No newline at end of file diff --git a/package.json b/package.json index b2f0cf8..ec6d202 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "repository" : { "type" : "git", - "url" : "https://github.com/loopj/jquery-simple-slider.git" + "url" : "https://github.com/BME-IK/jquery-simple-slider" }, "bugs" : { "url" : "https://github.com/loopj/jquery-simple-slider/issues"