PageSourceSearch

https://static.foxnews.com/static/orion/scripts/core/utils/jquery/plugins/rangeslider.js

js foxnews.com collected 2026-10-01 09:13:13 UTC 9,477 bytes, 2 lines download raw bytes

1/*! updated; 09-28-2026 11:57 AM **/
2(factory=>{"function"==typeof define&&define.amd?define(["jquery"],factory):"object"==typeof exports?module.exports=factory(require("jquery")):factory(jQuery)})(function($){Number.isNaN=Number.isNaN||function(value){return"number"==typeof value&&value!=value};var input,pluginIdentifier=0,hasInputRangeSupport=((input=document.createElement("input")).setAttribute("type","range"),"text"!==input.type),defaults={polyfill:!0,orientation:"horizontal",rangeClass:"rangeslider",disabledClass:"rangeslider--disabled",activeClass:"rangeslider--active",horizontalClass:"rangeslider--horizontal",verticalClass:"rangeslider--vertical",fillClass:"rangeslider__fill",handleClass:"rangeslider__handle",startEvent:["mousedown","touchstart","pointerdown"],moveEvent:["mousemove","touchmove","pointermove"],endEvent:["mouseup","touchend","pointerup"]},constants={orientation:{horizontal:{dimension:"width",direction:"left",directionStyle:"left",coordinate:"x"},vertical:{dimension:"height",direction:"top",directionStyle:"bottom",coordinate:"y"}}};function getDimension(element,key){var hiddenParentNodes=(element=>{for(var parents=[],node=element.parentNode;(element=>element&&(0===element.offsetWidth||0===element.offsetHeight||!1===element.open))(node);)parents.push(node),node=node.parentNode;return parents})(element),hiddenParentNodesLength=hiddenParentNodes.length,inlineStyle=[],dimension=element[key];function toggleOpenProperty(element){void 0!==element.open&&(element.open=!element.open)}if(hiddenParentNodesLength){for(var i=0;i<hiddenParentNodesLength;i++)inlineStyle[i]=hiddenParentNodes[i].style.cssText,hiddenParentNodes[i].style.setProperty?hiddenParentNodes[i].style.setProperty("display","block","important"):hiddenParentNodes[i].style.cssText+=";display: block !important",hiddenParentNodes[i].style.height="0",hiddenParentNodes[i].style.overflow="hidden",hiddenParentNodes[i].style.visibility="hidden",toggleOpenProperty(hiddenParentNodes[i]);for(var dimension=element[key],j=0;j<hiddenParentNodesLength;j++)hiddenParentNodes[j].style.cssText=inlineStyle[j],toggleOpenProperty(hiddenParentNodes[j])}return dimension}function tryParseFloat(str,defaultValue){str=parseFloat(str);return Number.isNaN(str)?defaultValue:str}function ucfirst(str){return str.charAt(0).toUpperCase()+str.substr(1)}function Plugin(element,options){if(this.$window=$(window),this.$document=$(document),this.$element=$(element),this.options=$.extend({},defaults,options),this.polyfill=this.options.polyfill,this.orientation=this.$element[0].getAttribute("data-orientation")||this.options.orientation,this.onInit=this.options.onInit,this.onSlide=this.options.onSlide,this.onSlideEnd=this.options.onSlideEnd,this.DIMENSION=constants.orientation[this.orientation].dimension,this.DIRECTION=constants.orientation[this.orientation].direction,this.DIRECTION_STYLE=constants.orientation[this.orientation].directionStyle,this.COORDINATE=constants.orientation[this.orientation].coordinate,this.polyfill&&hasInputRangeSupport)return!1;this.identifier="js-rangeslider-"+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.toFixed=(this.step+"").replace(".","").length-1,this.$fill=$('<div class="'+this.options.fillClass+'" />'),this.$handle=$('<div class="'+this.options.handleClass+'" />'),this.$range=$('<div class="'+this.options.rangeClass+" "+this.options[this.orientation+"Class"]+'" id="'+this.identifier+'" />').insertAfter(this.$element).prepend(this.$fill,this.$handle),this.$element.css({position:"absolute",width:"1px",height:"1px",overflow:"hidden",opacity:"0"}),this.handleDown=$.proxy(this.handleDown,this),this.handleMove=$.proxy(this.handleMove,this),this.handleEnd=$.proxy(this.handleEnd,this),this.init();var fn,debounceDuration,_this=this;this.$window.on("resize."+this.identifier,(fn=function(){!function(fn,wait){var args=Array.prototype.slice.call(arguments,2);setTimeout(function(){return fn.apply(null,args)},wait)}(function(){_this.update(!1,!1)},300)},debounceDuration=(debounceDuration=20)||100,function(){var args;return fn.debouncing||(args=Array.prototype.slice.apply(arguments),fn.lastReturnVal=fn.apply(window,args),fn.debouncing=!0),clearTimeout(fn.debounceTimeout),fn.debounceTimeout=setTimeout(function(){fn.debouncing=!1},debounceDuration),fn.lastReturnVal})),this.$document.on(this.startEvent,"#"+this.identifier+":not(."+this.options.disabledClass+")",this.handleDown),this.$element.on("change."+this.identifier,function(e,data){data&&data.origin===_this.identifier||(data=e.target.value,e=_this.getPositionFromValue(data),_this.setPosition(e))})}return Plugin.prototype.init=function(){this.update(!0,!1),this.onInit&&"function"==typeof this.onInit&&this.onInit()},Plugin.prototype.update=function(updateAttributes,triggerSlide){(updateAttributes=updateAttributes||!1)&&(this.min=tryParseFloat(this.$element[0].getAttribute("min"),0),this.max=tryParseFloat(this.$element[0].getAttribute("max"),100),this.value=tryParseFloat(this.$element[0].value,Math.round(this.min+(this.max-this.min)/2)),this.step=tryParseFloat(this.$element[0].getAttribute("step"),1)),this.handleDimension=getDimension(this.$handle[0],"offset"+ucfirst(this.DIMENSION)),this.rangeDimension=getDimension(this.$range[0],"offset"+ucfirst(this.DIMENSION)),this.maxHandlePos=this.rangeDimension-this.handleDimension,this.grabPos=this.handleDimension/2,this.position=this.getPositionFromValue(this.value),this.$element[0].disabled?this.$range.addClass(this.options.disabledClass):this.$range.removeClass(this.options.disabledClass),this.setPosition(this.position,triggerSlide)},Plugin.prototype.handleDown=function(e){var rangePos,setPos;e.preventDefault(),this.$document.on(this.moveEvent,this.handleMove),this.$document.on(this.endEvent,this.handleEnd),this.$range.addClass(this.options.activeClass),-1<(" "+e.target.className+" ").replace(/[\n\t]/g," ").indexOf(this.options.handleClass)||(e=this.getRelativePosition(e),rangePos=this.$range[0].getBoundingClientRect()[this.DIRECTION],rangePos=this.getPositionFromNode(this.$handle[0])-rangePos,setPos="vertical"===this.orientation?this.maxHandlePos-(e-this.grabPos):e-this.grabPos,this.setPosition(setPos),rangePos<=e&&e<rangePos+this.handleDimension&&(this.grabPos=e-rangePos))},Plugin.prototype.handleMove=function(e){e.preventDefault();e=this.getRelativePosition(e),e="vertical"===this.orientation?this.maxHandlePos-(e-this.grabPos):e-this.grabPos;this.setPosition(e)},Plugin.prototype.handleEnd=function(e){e.preventDefault(),this.$document.off(this.moveEvent,this.handleMove),this.$document.off(this.endEvent,this.handleEnd),this.$range.removeClass(this.options.activeClass),this.$element.trigger("change",{origin:this.identifier}),this.onSlideEnd&&"function"==typeof this.onSlideEnd&&this.onSlideEnd(this.position,this.value)},Plugin.prototype.cap=function(pos,min,max){return pos<min?min:max<pos?max:pos},Plugin.prototype.setPosition=function(pos,triggerSlide){var newPos;void 0===triggerSlide&&(triggerSlide=!0),pos=this.getValueFromPosition(this.cap(pos,0,this.maxHandlePos)),newPos=this.getPositionFromValue(pos),this.$fill[0].style[this.DIMENSION]=newPos+this.grabPos+"px",this.$handle[0].style[this.DIRECTION_STYLE]=newPos+"px",this.setValue(pos),this.position=newPos,this.value=pos,triggerSlide&&this.onSlide&&"function"==typeof this.onSlide&&this.onSlide(newPos,pos)},Plugin.prototype.getPositionFromNode=function(node){for(var i=0;null!==node;)i+=node.offsetLeft,node=node.offsetParent;return i},Plugin.prototype.getRelativePosition=function(e){var ucCoordinate=ucfirst(this.COORDINATE),rangePos=this.$range[0].getBoundingClientRect()[this.DIRECTION],pageCoordinate=0;return void 0!==e.originalEvent["client"+ucCoordinate]?pageCoordinate=e.originalEvent["client"+ucCoordinate]:e.originalEvent.touches&&e.originalEvent.touches[0]&&void 0!==e.originalEvent.touches[0]["client"+ucCoordinate]?pageCoordinate=e.originalEvent.touches[0]["client"+ucCoordinate]:e.currentPoint&&void 0!==e.currentPoint[this.COORDINATE]&&(pageCoordinate=e.currentPoint[this.COORDINATE]),pageCoordinate-rangePos},Plugin.prototype.getPositionFromValue=function(value){value=(value-this.min)/(this.max-this.min);return Number.isNaN(value)?0:value*this.maxHandlePos},Plugin.prototype.getValueFromPosition=function(pos){pos/=this.maxHandlePos||1,pos=this.step*Math.round(pos*(this.max-this.min)/this.step)+this.min;return Number(pos.toFixed(this.toFixed))},Plugin.prototype.setValue=function(value){value===this.value&&""!==this.$element[0].value||this.$element.val(value).trigger("input",{origin:this.identifier})},Plugin.prototype.destroy=function(){this.$document.off("."+this.identifier),this.$window.off("."+this.identifier),this.$element.off("."+this.identifier).removeAttr("style").removeData("plugin_rangeslider"),this.$range&&this.$range.length&&this.$range[0].parentNode.removeChild(this.$range[0])},$.fn.rangeslider=function(options){var args=Array.prototype.slice.call(arguments,1
2);return this.each(function(){var $this=$(this),data=$this.data("plugin_rangeslider");data||$this.data("plugin_rangeslider",data=new Plugin(this,options)),"string"==typeof options&&data[options].apply(data,args)})},"rangeslider.js is available in jQuery context e.g $(selector).rangeslider(options);"});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.