Permalink
Browse files

remove

  • Loading branch information...
1 parent 7f2591d commit eb533cb2fd9ef7915128e74932fcc0149b0bbede @leongersen committed Feb 21, 2012
Showing with 0 additions and 349 deletions.
  1. +0 −348 jquery.nouislider_0.9.4.js
  2. +0 −1 jquery.nouislider_0.9.4.min.js
View
348 jquery.nouislider_0.9.4.js
@@ -1,348 +0,0 @@
- (function( $ ){
-
- $.fn.noUiSlider = function( method, options ) {
-
- var settings = {
- 'dontActivate' : '', // Set to Upper or lower. Default = '';
- 'bar' : '', // Use bar
- 'startMax' : 75, // Percentage of the sliderbar to set the noUi_upperHandle to;
- 'startMin' : 25, // Percentage of the sliderbar to set the noUi_lowerHandle to;
- 'minValue' : 0, // Minimum selectable. Default: 0;
- 'maxValue' : 'full', // Maximum selectable. Default: 'full';
- 'point' : 'lower', // Set point for Getvalue function. Default 'lower'.
- // Callbacks
- 'callback' : '', // Callback to be triggered on release of dot.
- 'tracker' : '', // Callback to be triggered on every dot movement.
- 'clickmove' : '', // Callback to be triggered on movement by clicking.
- 'step' : 0, // ALPHA: Set the slider to make steps in stead of fluid sliding.
- 'minLimit' : 0, // Default zero point for getValue calculator.
- 'maxLimit' : 100 // Default maxpoint for getValue calculator.
- };
-
- var methods = {
-
- init: function init(){
-
- return this.each(function(){
-
- function activate(useObject){
-
- $(useObject).click(function(e) { e.stopPropagation(); });
-
- // ClickMove
-
- var mainBarClick = useObject.parent();
-
- $(mainBarClick).click(function(e){
-
- var dot0 = e.pageX;
- var thebar = $(mainBarClick).offset();
-
- if ( options.dontActivate != "lower" && options.dontActivate != "upper" ){
-
- var dot1 = $(mainBarClick).children(".noUi_lowerHandle").offset();
- dot1 = dot1.left;
- var dot2 = $(mainBarClick).children(".noUi_upperHandle").offset();
- dot2 = dot2.left;
-
- var z = ( (dot1 + dot2) / 2 );
-
- if ( dot0 > z ){
- $(mainBarClick).children(".noUi_upperHandle").css("left", (dot0 - thebar.left));
- } else {
- $(mainBarClick).children(".noUi_lowerHandle").css("left", (dot0 - thebar.left));
- }
-
- } else {
-
- if ( options.dontActivate != "lower" ){
- $(mainBarClick).children(".noUi_lowerHandle").css("left", (dot0 - thebar.left));
- }
- if ( options.dontActivate != "upper" ){
- $(mainBarClick).children(".noUi_upperHandle").css("left", (dot0 - thebar.left));
- }
-
- }
-
- if ( options.bar != "off"){
- setMidBar(mainBarClick);
- }
-
- if ( typeof options.clickmove == "function" ){
- options.clickmove.call(this);
- }
-
- });
-
- // -
-
- function setMidBar(useMidObject){
-
- var one = $(useMidObject).children(".noUi_lowerHandle").css('left');
- var two = $(useMidObject).children(".noUi_upperHandle").css('left');
-
- one = parseInt(one.replace("px",""));
- two = parseInt(two.replace("px",""));
-
- $(useMidObject).children(".noUi_midBar").css("left",(one+lowerWidth)).css("width",(two-(one+lowerWidth)));
-
- }
-
- function getMinimum(useMinObject){
-
- var minimumavailable = options.minValue; // Setting
-
- if ( useMinObject.hasClass('noUi_lowerHandle') ){
-
- return minimumavailable;
-
- } else {
-
- var value = $(useMinObject).parent().children('.noUi_lowerHandle').css("left");
- value = value.replace("px","");
- value = parseInt(value);
-
- return ( lowerWidth + value );
-
- }
- }
-
- function getMaximum(useMaxObject){
-
- var maximumavailable = options.maxValue; // Setting
-
- if ( maximumavailable == 'full' ){
-
- maximumavailable = $(useMaxObject).parent().css('width');
- maximumavailable = maximumavailable.replace("px","");
- maximumavailable = maximumavailable - upperWidth;
- }
-
- if ( useMaxObject.hasClass('noUi_upperHandle') ){
-
- return maximumavailable;
-
- } else {
-
- var value = $(useMaxObject).parent().children('.noUi_upperHandle').css("left");
- value = value.replace("px","");
- value = parseInt(value);
- value = value - lowerWidth;
-
- return ( value );
-
- }
-
- }
-
- var mainObject = useObject.parent();
-
- $(useObject).mousedown(function(e){
-
- var previousxpos = e.pageX;
- var previousstore;
- var counter = 0;
- var currentvalue;
- var poselementleft = $(this).css("left");
- poselementleft = poselementleft.replace("px","");
- var registeredmovement;
-
- $(useObject).children().addClass('noUi_activeHandle');
-
- $(document).mousemove(function(f){
-
- if ( options.step == 0 ){
-
- poselementleft = $(useObject).css("left");
- poselementleft = poselementleft.replace("px","");
-
- currentvalue = f.pageX;
- registeredmovement = currentvalue - previousxpos;
-
- var tomove = parseInt(poselementleft) + parseInt(registeredmovement);
-
- if (tomove > getMinimum(useObject)){
-
- if (tomove <= getMaximum(useObject) ){
- $(useObject).css("left",tomove);
- } else {
- $(useObject).css("left",getMaximum(useObject));
- }
-
- } else {
- $(useObject).css("left",getMinimum(useObject));
- }
-
- if ( options.bar != "off"){
- setMidBar(mainObject);
- }
-
- previousxpos = currentvalue;
-
- } else {
-
- if ( f.pageX > previousstore ) {
- counter++;
- } else {
- counter--;
- }
-
- var maxwidth = $(useObject).parent().css('width');
- maxwidth = parseInt(maxwidth.replace("px",""));
-
- var maxstep = (( maxwidth * options.step ) / 100 );
-
- if ( counter > maxstep || counter < ( -1 * maxstep ) ){
-
- poselementleft = $(useObject).css("left");
- poselementleft = parseInt(poselementleft.replace("px",""));
-
- $(useObject).css("left", poselementleft + counter);
- counter = 0;
-
- setMidBar(mainObject);
-
- }
-
- previousstore = f.pageX;
-
- }
-
- if ( typeof options.tracker == 'function' ){
- options.tracker.call(this);
- }
-
- });
-
- $(document).bind('mouseup.NoUiSlider', function(){
-
- $(useObject).children().removeClass('noUi_activeHandle');
-
- $(document).unbind('mousemove');
- $(document).unbind('mouseup.NoUiSlider');
-
- if( typeof options.callback == 'function' ){
- options.callback.call(this);
- }
-
- });
-
- });
-
- if ( options.bar != "off"){
- setMidBar(mainObject);
- }
-
- }
-
- // Add required children to sliderbar
-
- $(this).css('position','relative').append('<div class="noUi_handle noUi_lowerHandle" onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false"><div class="noUi_sliderKnob"></div></div>');
-
- // If the midbar is to be used...
- if ( options.bar != "off"){
- $(this).append('<div class="noUi_midBar"></div>');
- }
-
- $(this).append('<div class="noUi_handle noUi_upperHandle" onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false"><div class="noUi_sliderKnob"></div></div><div style="display:none !important;" id="noUi_wait"></div>');
-
- $(this).children().css('position', 'absolute');
-
- // Hide unwanted dots
- if ( options.dontActivate == "upper" ){
- $(this).children(".noUi_upperHandle").css('width',0).children(".noUi_sliderKnob").hide();
- }
- if ( options.dontActivate == "lower" ){
- $(this).children(".noUi_lowerHandle").css('width',0).children(".noUi_sliderKnob").hide();
- }
-
- // Get width's of dots.
- var lowerWidth = $(this).children(".noUi_lowerHandle").css('width')
- lowerWidth = parseInt(lowerWidth.replace("px",""));
- var upperWidth = $(this).children(".noUi_upperHandle").css('width')
- upperWidth = parseInt(upperWidth.replace("px",""));
-
- // Get width of bar.
- var maxwidth = parseInt(($(this).css('width')).replace("px",""));
-
- // Set dots to defined starting point.
- var startMaxValue = ( ( (options.startMax) * ( maxwidth - upperWidth) ) / 100 );
- var startMinValue = ( ( (options.startMin) * ( maxwidth - lowerWidth) ) / 100 );
-
- $(this).children(".noUi_lowerHandle").css('left',startMinValue);
- $(this).children(".noUi_upperHandle").css('left',startMaxValue);
-
- // Activate, if requested.
- if ( options.dontActivate != "upper" ){
- activate($(this).children(".noUi_upperHandle"));
- }
- if ( options.dontActivate != "lower" ){
- activate($(this).children(".noUi_lowerHandle"));
- }
-
- }); // end of return this.
-
- },
-
- getValue: function getValue(){
-
- var lowerWidth = this.children(".noUi_lowerHandle").css('width')
- lowerWidth = parseInt(lowerWidth.replace("px",""));
- var upperWidth = this.children(".noUi_upperHandle").css('width')
- upperWidth = parseInt(upperWidth.replace("px",""));
-
- var maxwidth = this.css('width');
- maxwidth = maxwidth.replace("px","");
-
- scaleMin = options.minLimit;
- scaleMax = options.maxLimit;
- useObject = options.point;
-
- if ( useObject == "lower" ){
- var val = $(this.children(".noUi_lowerHandle")).css("left");
- val = parseInt(val.replace("px",""));
- maxwidth = maxwidth - lowerWidth;
- }
-
- if ( useObject == "upper" ){
- var val = $(this.children(".noUi_upperHandle")).css("left");
- val = parseInt(val.replace("px",""));
- maxwidth = maxwidth - upperWidth;
- }
-
- var calc = ( ( scaleMax - scaleMin ) );
- calc = ( maxwidth / calc );
- calc = ( val / calc );
-
- return ( calc + scaleMin ) ;
- }
-
- };
-
- if ( options ){
- if ( options.dontActivate ) {
-
- if ( !options.startMin ){
- options.startMin = 0;
- }
-
- if ( !options.startMax ){
- options.startMax = 100;
- }
-
- }
- }
-
- var options = $.extend( settings, options );
-
- if ( methods[method] ) {
- return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 ));
- } else if ( typeof method === 'object' || ! method ) {
- return methods.init.apply( this, arguments );
- } else {
- $.error( 'Method ' + method + ' does not exist on jQuery.noUiSlider' );
- }
-
- };
-
- })( jQuery );
View
1 jquery.nouislider_0.9.4.min.js
@@ -1 +0,0 @@
-(function(a){a.fn.noUiSlider=function(b,c){var d={dontActivate:"",bar:"",startMax:75,startMin:25,minValue:0,maxValue:"full",point:"lower",callback:"",tracker:"",clickmove:"",step:0,minLimit:0,maxLimit:100};var e={init:function f(){return this.each(function(){function b(b){function i(b){var f=c.maxValue;if(f=="full"){f=a(b).parent().css("width");f=f.replace("px","");f=f-e}if(b.hasClass("noUi_upperHandle")){return f}else{var g=a(b).parent().children(".noUi_upperHandle").css("left");g=g.replace("px","");g=parseInt(g);g=g-d;return g}}function h(b){var e=c.minValue;if(b.hasClass("noUi_lowerHandle")){return e}else{var f=a(b).parent().children(".noUi_lowerHandle").css("left");f=f.replace("px","");f=parseInt(f);return d+f}}function g(b){var c=a(b).children(".noUi_lowerHandle").css("left");var e=a(b).children(".noUi_upperHandle").css("left");c=parseInt(c.replace("px",""));e=parseInt(e.replace("px",""));a(b).children(".noUi_midBar").css("left",c+d).css("width",e-(c+d))}a(b).click(function(a){a.stopPropagation()});var f=b.parent();a(f).click(function(b){var d=b.pageX;var e=a(f).offset();if(c.dontActivate!="lower"&&c.dontActivate!="upper"){var h=a(f).children(".noUi_lowerHandle").offset();h=h.left;var i=a(f).children(".noUi_upperHandle").offset();i=i.left;var j=(h+i)/2;if(d>j){a(f).children(".noUi_upperHandle").css("left",d-e.left)}else{a(f).children(".noUi_lowerHandle").css("left",d-e.left)}}else{if(c.dontActivate!="lower"){a(f).children(".noUi_lowerHandle").css("left",d-e.left)}if(c.dontActivate!="upper"){a(f).children(".noUi_upperHandle").css("left",d-e.left)}}if(c.bar!="off"){g(f)}if(typeof c.clickmove=="function"){c.clickmove.call(this)}});var j=b.parent();a(b).mousedown(function(d){var e=d.pageX;var f;var k=0;var l;var m=a(this).css("left");m=m.replace("px","");var n;a(b).children().addClass("noUi_activeHandle");a(document).mousemove(function(d){if(c.step==0){m=a(b).css("left");m=m.replace("px","");l=d.pageX;n=l-e;var o=parseInt(m)+parseInt(n);if(o>h(b)){if(o<=i(b)){a(b).css("left",o)}else{a(b).css("left",i(b))}}else{a(b).css("left",h(b))}if(c.bar!="off"){g(j)}e=l}else{if(d.pageX>f){k++}else{k--}var p=a(b).parent().css("width");p=parseInt(p.replace("px",""));var q=p*c.step/100;if(k>q||k<-1*q){m=a(b).css("left");m=parseInt(m.replace("px",""));a(b).css("left",m+k);k=0;g(j)}f=d.pageX}if(typeof c.tracker=="function"){c.tracker.call(this)}});a(document).bind("mouseup.NoUiSlider",function(){a(b).children().removeClass("noUi_activeHandle");a(document).unbind("mousemove");a(document).unbind("mouseup.NoUiSlider");if(typeof c.callback=="function"){c.callback.call(this)}})});if(c.bar!="off"){g(j)}}a(this).css("position","relative").append('<div class="noUi_handle noUi_lowerHandle" onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false"><div class="noUi_sliderKnob"></div></div>');if(c.bar!="off"){a(this).append('<div class="noUi_midBar"></div>')}a(this).append('<div class="noUi_handle noUi_upperHandle" onmousedown="event.preventDefault ? event.preventDefault() : event.returnValue = false"><div class="noUi_sliderKnob"></div></div><div style="display:none !important;" id="noUi_wait"></div>');a(this).children().css("position","absolute");if(c.dontActivate=="upper"){a(this).children(".noUi_upperHandle").css("width",0).children(".noUi_sliderKnob").hide()}if(c.dontActivate=="lower"){a(this).children(".noUi_lowerHandle").css("width",0).children(".noUi_sliderKnob").hide()}var d=a(this).children(".noUi_lowerHandle").css("width");d=parseInt(d.replace("px",""));var e=a(this).children(".noUi_upperHandle").css("width");e=parseInt(e.replace("px",""));var f=parseInt(a(this).css("width").replace("px",""));var g=c.startMax*(f-e)/100;var h=c.startMin*(f-d)/100;a(this).children(".noUi_lowerHandle").css("left",h);a(this).children(".noUi_upperHandle").css("left",g);if(c.dontActivate!="upper"){b(a(this).children(".noUi_upperHandle"))}if(c.dontActivate!="lower"){b(a(this).children(".noUi_lowerHandle"))}})},getValue:function g(){var b=this.children(".noUi_lowerHandle").css("width");b=parseInt(b.replace("px",""));var d=this.children(".noUi_upperHandle").css("width");d=parseInt(d.replace("px",""));var e=this.css("width");e=e.replace("px","");scaleMin=c.minLimit;scaleMax=c.maxLimit;useObject=c.point;if(useObject=="lower"){var f=a(this.children(".noUi_lowerHandle")).css("left");f=parseInt(f.replace("px",""));e=e-b}if(useObject=="upper"){var f=a(this.children(".noUi_upperHandle")).css("left");f=parseInt(f.replace("px",""));e=e-d}var g=scaleMax-scaleMin;g=e/g;g=f/g;return g+scaleMin}};if(c){if(c.dontActivate){if(!c.startMin){c.startMin=0}if(!c.startMax){c.startMax=100}}}var c=a.extend(d,c);if(e[b]){return e[b].apply(this,Array.prototype.slice.call(arguments,1))}else if(typeof b==="object"||!b){return e.init.apply(this,arguments)}else{a.error("Method "+b+" does not exist on jQuery.noUiSlider")}}})(jQuery)

0 comments on commit eb533cb

Please sign in to comment.