You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ion.rangeSlider-backup.min.js 34KB

12
  1. /*! SmartAdmin - v1.5.2 - 2015-04-23 */!function(a,b,c,d){"use strict";var e=0,f=function(){var b,c=d.userAgent,e=/msie\s\d+/i;return c.search(e)>0&&(b=e.exec(c).toString(),b=b.split(" ")[1],9>b)?(a("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,c=[].slice;if("function"!=typeof b)throw new TypeError;var d=c.call(arguments,1),e=function(){if(this instanceof e){var f=function(){};f.prototype=b.prototype;var g=new f,h=b.apply(g,d.concat(c.call(arguments)));return Object(h)===h?h:g}return b.apply(a,d.concat(c.call(arguments)))};return e}),Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null==this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(1/0===Math.abs(f)&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1});var g='<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>',h='<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>',i='<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>',j='<span class="irs-disable-mask"></span>',k=function(d,e,f){this.VERSION="2.0.6",this.input=d,this.plugin_count=f,this.current_plugin=0,this.calc_count=0,this.old_from=0,this.old_to=0,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.is_key=!1,this.is_update=!1,this.is_start=!0,this.is_active=!1,this.is_resize=!1,this.is_click=!1,this.$cache={"win":a(c),"body":a(b.body),"input":a(d),"cont":null,"rs":null,"min":null,"max":null,"from":null,"to":null,"single":null,"bar":null,"line":null,"s_single":null,"s_from":null,"s_to":null,"shad_single":null,"shad_from":null,"shad_to":null,"grid":null,"grid_labels":[]};var g=this.$cache.input,h={"type":g.data("type"),"min":g.data("min"),"max":g.data("max"),"from":g.data("from"),"to":g.data("to"),"step":g.data("step"),"min_interval":g.data("minInterval"),"max_interval":g.data("maxInterval"),"drag_interval":g.data("dragInterval"),"values":g.data("values"),"from_fixed":g.data("fromFixed"),"from_min":g.data("fromMin"),"from_max":g.data("fromMax"),"from_shadow":g.data("fromShadow"),"to_fixed":g.data("toFixed"),"to_min":g.data("toMin"),"to_max":g.data("toMax"),"to_shadow":g.data("toShadow"),"prettify_enabled":g.data("prettifyEnabled"),"prettify_separator":g.data("prettifySeparator"),"force_edges":g.data("forceEdges"),"keyboard":g.data("keyboard"),"keyboard_step":g.data("keyboardStep"),"grid":g.data("grid"),"grid_margin":g.data("gridMargin"),"grid_num":g.data("gridNum"),"grid_snap":g.data("gridSnap"),"hide_min_max":g.data("hideMinMax"),"hide_from_to":g.data("hideFromTo"),"prefix":g.data("prefix"),"postfix":g.data("postfix"),"max_postfix":g.data("maxPostfix"),"decorate_both":g.data("decorateBoth"),"values_separator":g.data("valuesSeparator"),"disable":g.data("disable")};h.values=h.values&&h.values.split(","),e=a.extend(h,e);var i=g.prop("value");i&&(i=i.split(";"),i[0]&&i[0]==+i[0]&&(i[0]=+i[0]),i[1]&&i[1]==+i[1]&&(i[1]=+i[1]),e.values&&e.values.length?(h.from=i[0]&&e.values.indexOf(i[0]),h.to=i[1]&&e.values.indexOf(i[1])):(h.from=i[0]&&+i[0],h.to=i[1]&&+i[1])),this.options=a.extend({"type":"single","min":10,"max":100,"from":null,"to":null,"step":1,"min_interval":0,"max_interval":0,"drag_interval":!1,"values":[],"p_values":[],"from_fixed":!1,"from_min":null,"from_max":null,"from_shadow":!1,"to_fixed":!1,"to_min":null,"to_max":null,"to_shadow":!1,"prettify_enabled":!0,"prettify_separator":" ","prettify":null,"force_edges":!1,"keyboard":!1,"keyboard_step":5,"grid":!1,"grid_margin":!0,"grid_num":4,"grid_snap":!1,"hide_min_max":!1,"hide_from_to":!1,"prefix":"","postfix":"","max_postfix":"","decorate_both":!0,"values_separator":" \u2014 ","disable":!1,"onStart":null,"onChange":null,"onFinish":null,"onUpdate":null},e),this.validate(),this.result={"input":this.$cache.input,"slider":null,"min":this.options.min,"max":this.options.max,"from":this.options.from,"from_percent":0,"from_value":null,"to":this.options.to,"to_percent":0,"to_value":null},this.coords={"x_gap":0,"x_pointer":0,"w_rs":0,"w_rs_old":0,"w_handle":0,"p_gap":0,"p_gap_left":0,"p_gap_right":0,"p_step":0,"p_pointer":0,"p_handle":0,"p_single":0,"p_single_real":0,"p_from":0,"p_from_real":0,"p_to":0,"p_to_real":0,"p_bar_x":0,"p_bar_w":0,"grid_gap":0,"big_num":0,"big":[],"big_w":[],"big_p":[],"big_x":[]},this.labels={"w_min":0,"w_max":0,"w_from":0,"w_to":0,"w_single":0,"p_min":0,"p_max":0,"p_from":0,"p_from_left":0,"p_to":0,"p_to_left":0,"p_single":0,"p_single_left":0},this.init()};k.prototype={"init":function(a){this.coords.p_step=this.options.step/((this.options.max-this.options.min)/100),this.target="base",this.toggleInput(),this.append(),this.setMinMax(),a?(this.force_redraw=!0,this.calc(!0),this.options.onUpdate&&"function"==typeof this.options.onUpdate&&this.options.onUpdate(this.result)):(this.force_redraw=!0,this.calc(!0),this.options.onStart&&"function"==typeof this.options.onStart&&this.options.onStart(this.result)),this.updateScene(),this.raf_id=requestAnimationFrame(this.updateScene.bind(this))},"append":function(){var a='<span class="irs js-irs-'+this.plugin_count+'"></span>';this.$cache.input.before(a),this.$cache.input.prop("readonly",!0),this.$cache.cont=this.$cache.input.prev(),this.result.slider=this.$cache.cont,this.$cache.cont.html(g),this.$cache.rs=this.$cache.cont.find(".irs"),this.$cache.min=this.$cache.cont.find(".irs-min"),this.$cache.max=this.$cache.cont.find(".irs-max"),this.$cache.from=this.$cache.cont.find(".irs-from"),this.$cache.to=this.$cache.cont.find(".irs-to"),this.$cache.single=this.$cache.cont.find(".irs-single"),this.$cache.bar=this.$cache.cont.find(".irs-bar"),this.$cache.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append(h),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append(i),this.$cache.s_from=this.$cache.cont.find(".from"),this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to")),this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none"),this.appendGrid(),this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass("irs-disabled"),this.$cache.input[0].disabled=!1,this.bindEvents())},"appendDisableMask":function(){this.$cache.cont.append(j),this.$cache.cont.addClass("irs-disabled")},"remove":function(){this.$cache.cont.remove(),this.$cache.cont=null,this.$cache.line.off("keydown.irs_"+this.plugin_count),this.$cache.body.off("touchmove.irs_"+this.plugin_count),this.$cache.body.off("mousemove.irs_"+this.plugin_count),this.$cache.win.off("touchend.irs_"+this.plugin_count),this.$cache.win.off("mouseup.irs_"+this.plugin_count),f&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count)),this.$cache.grid_labels=[],this.coords.big=[],this.coords.big_w=[],this.coords.big_p=[],this.coords.big_x=[],cancelAnimationFrame(this.raf_id)},"bindEvents":function(){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.body.on("mousemove.irs_"+this.plugin_count,this.pointerMove.bind(this)),this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),"single"===this.options.type?(this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))),this.options.keyboard&&this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),f&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))},"pointerMove":function(a){if(this.dragging){var b=a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX;this.coords.x_pointer=b-this.coords.x_gap,this.calc()}},"pointerUp":function(b){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;var c=this.options.onFinish&&"function"==typeof this.options.onFinish,d=a.contains(this.$cache.cont[0],b.target)||this.dragging;c&&d&&this.options.onFinish(this.result),this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,this.dragging=!1,f&&a("*").prop("unselectable",!1)}},"pointerDown":function(b,c){c.preventDefault();var d=c.pageX||c.originalEvent.touches&&c.originalEvent.touches[0].pageX;if(2!==c.button){switch(this.current_plugin=this.plugin_count,this.target=b,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=d-this.coords.x_gap,this.calcPointer(),b){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single);break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.$cache.s_from.addClass("state_hover"),this.$cache.s_from.addClass("type_last"),this.$cache.s_to.removeClass("type_last");break;case"to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to),this.$cache.s_to.addClass("state_hover"),this.$cache.s_to.addClass("type_last"),this.$cache.s_from.removeClass("type_last");break;case"both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from),this.coords.p_gap_right=this.toFixed(this.coords.p_to-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}f&&a("*").prop("unselectable",!0),this.$cache.line.trigger("focus")}},"pointerClick":function(a,b){b.preventDefault();var c=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(c-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},"key":function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault(),this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},"moveByKey":function(a){var b=this.coords.p_pointer;a?b+=this.options.keyboard_step:b-=this.options.keyboard_step,this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b),this.is_key=!0,this.calc()},"setMinMax":function(){if(this.options){if(this.options.hide_min_max)return this.$cache.min[0].style.display="none",void(this.$cache.max[0].style.display="none");this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)}},"calc":function(a){if(this.options&&(this.calc_count++,(10===this.calc_count||a)&&(this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1)),this.coords.w_rs)){this.calcPointer(),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100);var b=100-this.coords.p_handle,c=this.toFixed(this.coords.p_pointer-this.coords.p_gap);switch("click"===this.target&&(c=this.toFixed(this.coords.p_pointer-this.coords.p_handle/2),this.target=this.chooseHandle(c)),0>c?c=0:c>b&&(c=b),this.target){case"base":var d=(this.options.max-this.options.min)/100,e=(this.result.from-this.options.min)/d,f=(this.result.to-this.options.min)/d;this.coords.p_single_real=this.toFixed(e),this.coords.p_from_real=this.toFixed(e),this.coords.p_to_real=this.toFixed(f),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_single=this.toFixed(e-this.coords.p_handle/100*e),this.coords.p_from=this.toFixed(e-this.coords.p_handle/100*e),this.coords.p_to=this.toFixed(f-this.coords.p_handle/100*f),this.target=null;break;case"single":if(this.options.from_fixed)break;this.coords.p_single_real=this.calcWithStep(c/b*100),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single=this.toFixed(this.coords.p_single_real/100*b);break;case"from":if(this.options.from_fixed)break;this.coords.p_from_real=this.calcWithStep(c/b*100),this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from=this.toFixed(this.coords.p_from_real/100*b);break;case"to":if(this.options.to_fixed)break;this.coords.p_to_real=this.calcWithStep(c/b*100),this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to=this.toFixed(this.coords.p_to_real/100*b);break;case"both":c=this.toFixed(c+.1*this.coords.p_handle),this.coords.p_from_real=this.calcWithStep((c-this.coords.p_gap_left)/b*100),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from"),this.coords.p_from=this.toFixed(this.coords.p_from_real/100*b),this.coords.p_to_real=this.calcWithStep((c+this.coords.p_gap_right)/b*100),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to"),this.coords.p_to=this.toFixed(this.coords.p_to_real/100*b)}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single,this.result.from_percent=this.coords.p_single_real,this.result.from=this.calcReal(this.coords.p_single_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to-this.coords.p_from),this.result.from_percent=this.coords.p_from_real,this.result.from=this.calcReal(this.coords.p_from_real),this.result.to_percent=this.coords.p_to_real,this.result.to=this.calcReal(this.coords.p_to_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to])),this.calcMinMax(),this.calcLabels()}},"calcPointer":function(){return this.coords.w_rs?(this.coords.x_pointer<0||isNaN(this.coords.x_pointer)?this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),void(this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100))):void(this.coords.p_pointer=0)},"chooseHandle":function(a){if("single"===this.options.type)return"single";var b=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2;return a>=b?"to":"from"},"calcMinMax":function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=this.labels.w_max/this.coords.w_rs*100)},"calcLabels":function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single+this.coords.p_handle/2-this.labels.p_single/2,this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single)):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from+this.coords.p_handle/2-this.labels.p_from/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to+this.coords.p_handle/2-this.labels.p_to/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=this.checkEdges(this.labels.p_to_left,this.labels.p_to),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to)/2-this.labels.p_single/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single)))},"updateScene":function(){this.options&&(this.drawHandles(),this.raf_id=requestAnimationFrame(this.updateScene.bind(this)))},"drawHandles":function(){if(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0),(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)&&(this.setMinMax(),this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow()),this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key))){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key){this.drawLabels(),this.$cache.bar[0].style.left=this.coords.p_bar_x+"%",this.$cache.bar[0].style.width=this.coords.p_bar_w+"%","single"===this.options.type?(this.$cache.s_single[0].style.left=this.coords.p_single+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value),this.$cache.input.data("from",this.result.from_value)):(this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from))):(this.$cache.s_from[0].style.left=this.coords.p_from+"%",this.$cache.s_to[0].style.left=this.coords.p_to+"%",(this.old_from!==this.result.from||this.force_redraw)&&(this.$cache.from[0].style.left=this.labels.p_from_left+"%"),(this.old_to!==this.result.to||this.force_redraw)&&(this.$cache.to[0].style.left=this.labels.p_to_left+"%"),this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?(this.$cache.input.prop("value",this.result.from_value+";"+this.result.to_value),this.$cache.input.data("from",this.result.from_value),this.$cache.input.data("to",this.result.to_value)):(this.$cache.input.prop("value",this.result.from+";"+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change"),this.old_from=this.result.from,this.old_to=this.result.to;var a=this.options.onChange&&"function"==typeof this.options.onChange&&!this.is_resize;!a||this.is_update||this.is_start||this.options.onChange(this.result);var b=this.options.onFinish&&"function"==typeof this.options.onFinish;b&&(this.is_key||this.is_click)&&this.options.onFinish(this.result),this.is_update=!1,this.is_resize=!1}this.is_start=!1,this.is_key=!1,this.is_click=!1,this.force_redraw=!1}},"drawLabels":function(){if(this.options){var a,b,c,d=this.options.values.length,e=this.options.p_values;if(!this.options.hide_from_to)if("single"===this.options.type)d?(a=this.decorate(e[this.result.from]),this.$cache.single.html(a)):(a=this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a)),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left<this.labels.p_min+1?"hidden":"visible",this.$cache.max[0].style.visibility=this.labels.p_single_left+this.labels.p_single>100-this.labels.p_max-1?"hidden":"visible";else{d?(this.options.decorate_both?(a=this.decorate(e[this.result.from]),a+=this.options.values_separator,a+=this.decorate(e[this.result.to])):a=this.decorate(e[this.result.from]+this.options.values_separator+e[this.result.to]),b=this.decorate(e[this.result.from]),c=this.decorate(e[this.result.to]),this.$cache.single.html(a),this.$cache.from.html(b),this.$cache.to.html(c)):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from)),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to))):a=this.decorate(this._prettify(this.result.from)+this.options.values_separator+this._prettify(this.result.to),this.result.from),b=this.decorate(this._prettify(this.result.from),this.result.from),c=this.decorate(this._prettify(this.result.to),this.result.to),this.$cache.single.html(a),this.$cache.from.html(b),this.$cache.to.html(c)),this.calcLabels();var f=Math.min(this.labels.p_single_left,this.labels.p_from_left),g=this.labels.p_single_left+this.labels.p_single,h=this.labels.p_to_left+this.labels.p_to,i=Math.max(g,h);this.labels.p_from_left+this.labels.p_from>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?(this.$cache.from[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden",i=h):(this.$cache.from[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",i=Math.max(g,h))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),this.$cache.min[0].style.visibility=f<this.labels.p_min+1?"hidden":"visible",this.$cache.max[0].style.visibility=i>100-this.labels.p_max-1?"hidden":"visible"}}},"drawShadow":function(){var a,b,c,d,e=this.options,f=this.$cache,g="number"==typeof e.from_min&&!isNaN(e.from_min),h="number"==typeof e.from_max&&!isNaN(e.from_max),i="number"==typeof e.to_min&&!isNaN(e.to_min),j="number"==typeof e.to_max&&!isNaN(e.to_max);"single"===e.type?e.from_shadow&&(g||h)?(a=this.calcPercent(e.from_min||e.min),b=this.calcPercent(e.from_max||e.max)-a,a=this.toFixed(a-this.coords.p_handle/100*a),b=this.toFixed(b-this.coords.p_handle/100*b),a+=this.coords.p_handle/2,f.shad_single[0].style.display="block",f.shad_single[0].style.left=a+"%",f.shad_single[0].style.width=b+"%"):f.shad_single[0].style.display="none":(e.from_shadow&&(g||h)?(a=this.calcPercent(e.from_min||e.min),b=this.calcPercent(e.from_max||e.max)-a,a=this.toFixed(a-this.coords.p_handle/100*a),b=this.toFixed(b-this.coords.p_handle/100*b),a+=this.coords.p_handle/2,f.shad_from[0].style.display="block",f.shad_from[0].style.left=a+"%",f.shad_from[0].style.width=b+"%"):f.shad_from[0].style.display="none",e.to_shadow&&(i||j)?(c=this.calcPercent(e.to_min||e.min),d=this.calcPercent(e.to_max||e.max)-c,c=this.toFixed(c-this.coords.p_handle/100*c),d=this.toFixed(d-this.coords.p_handle/100*d),c+=this.coords.p_handle/2,f.shad_to[0].style.display="block",f.shad_to[0].style.left=c+"%",f.shad_to[0].style.width=d+"%"):f.shad_to[0].style.display="none")},"toggleInput":function(){this.$cache.input.toggleClass("irs-hidden-input")},"calcPercent":function(a){var b=(this.options.max-this.options.min)/100,c=(a-this.options.min)/b;return this.toFixed(c)},"calcReal":function(a){var b=this.options.min,c=this.options.max,d=0;0>b&&(d=Math.abs(b),b+=d,c+=d);var e=(c-b)/100*a+b,f=this.options.step.toString().split(".")[1];return f?e=+e.toFixed(f.length):(e/=this.options.step,e*=this.options.step,e=+e.toFixed(0)),d&&(e-=d),e<this.options.min?e=this.options.min:e>this.options.max&&(e=this.options.max),f?+e.toFixed(f.length):this.toFixed(e)},"calcWithStep":function(a){var b=Math.round(a/this.coords.p_step)*this.coords.p_step;return b>100&&(b=100),100===a&&(b=100),this.toFixed(b)},"checkMinInterval":function(a,b,c){var d,e,f=this.options;return f.min_interval?(d=this.calcReal(a),e=this.calcReal(b),"from"===c?e-d<f.min_interval&&(d=e-f.min_interval):d-e<f.min_interval&&(d=e+f.min_interval),this.calcPercent(d)):a},"checkMaxInterval":function(a,b,c){var d,e,f=this.options;return f.max_interval?(d=this.calcReal(a),e=this.calcReal(b),"from"===c?e-d>f.max_interval&&(d=e-f.max_interval):d-e>f.max_interval&&(d=e+f.max_interval),this.calcPercent(d)):a},"checkDiapason":function(a,b,c){var d=this.calcReal(a),e=this.options;return b&&"number"==typeof b||(b=e.min),c&&"number"==typeof c||(c=e.max),b>d&&(d=b),d>c&&(d=c),this.calcPercent(d)},"toFixed":function(a){return a=a.toFixed(5),+a},"_prettify":function(a){return this.options.prettify_enabled?this.options.prettify&&"function"==typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},"prettify":function(a){var b=a.toString();return b.replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},"checkEdges":function(a,b){return this.options.force_edges?(0>a?a=0:a>100-b&&(a=100-b),this.toFixed(a)):this.toFixed(a)},"validate":function(){var a,b,c=this.options,d=this.result,e=c.values,f=e.length;if("string"==typeof c.min&&(c.min=+c.min),"string"==typeof c.max&&(c.max=+c.max),"string"==typeof c.from&&(c.from=+c.from),"string"==typeof c.to&&(c.to=+c.to),"string"==typeof c.step&&(c.step=+c.step),"string"==typeof c.from_min&&(c.from_min=+c.from_min),"string"==typeof c.from_max&&(c.from_max=+c.from_max),"string"==typeof c.to_min&&(c.to_min=+c.to_min),"string"==typeof c.to_max&&(c.to_max=+c.to_max),"string"==typeof c.keyboard_step&&(c.keyboard_step=+c.keyboard_step),"string"==typeof c.grid_num&&(c.grid_num=+c.grid_num),c.max<=c.min&&(c.max=c.min?2*c.min:c.min+1,c.step=1),f)for(c.p_values=[],c.min=0,c.max=f-1,c.step=1,c.grid_num=c.max,c.grid_snap=!0,b=0;f>b;b++)a=+e[b],isNaN(a)?a=e[b]:(e[b]=a,a=this._prettify(a)),c.p_values.push(a);("number"!=typeof c.from||isNaN(c.from))&&(c.from=c.min),("number"!=typeof c.to||isNaN(c.from))&&(c.to=c.max),(c.from<c.min||c.from>c.max)&&(c.from=c.min),(c.to>c.max||c.to<c.min)&&(c.to=c.max),"double"===c.type&&c.from>c.to&&(c.from=c.to),("number"!=typeof c.step||isNaN(c.step)||!c.step||c.step<0)&&(c.step=1),("number"!=typeof c.keyboard_step||isNaN(c.keyboard_step)||!c.keyboard_step||c.keyboard_step<0)&&(c.keyboard_step=5),c.from_min&&c.from<c.from_min&&(c.from=c.from_min),c.from_max&&c.from>c.from_max&&(c.from=c.from_max),c.to_min&&c.to<c.to_min&&(c.to=c.to_min),c.to_max&&c.from>c.to_max&&(c.to=c.to_max),d&&(d.min!==c.min&&(d.min=c.min),d.max!==c.max&&(d.max=c.max),(d.from<d.min||d.from>d.max)&&(d.from=c.from),(d.to<d.min||d.to>d.max)&&(d.to=c.to)),("number"!=typeof c.min_interval||isNaN(c.min_interval)||!c.min_interval||c.min_interval<0)&&(c.min_interval=0),("number"!=typeof c.max_interval||isNaN(c.max_interval)||!c.max_interval||c.max_interval<0)&&(c.max_interval=0),c.min_interval&&c.min_interval>c.max-c.min&&(c.min_interval=c.max-c.min),c.max_interval&&c.max_interval>c.max-c.min&&(c.max_interval=c.max-c.min)},"decorate":function(a,b){var c="",d=this.options;return d.prefix&&(c+=d.prefix),c+=a,d.max_postfix&&(d.values.length&&a===d.p_values[d.max]?(c+=d.max_postfix,d.postfix&&(c+=" ")):b===d.max&&(c+=d.max_postfix,d.postfix&&(c+=" "))),d.postfix&&(c+=d.postfix),c},"updateFrom":function(){this.result.from=this.options.from,this.result.from_percent=this.calcPercent(this.result.from),this.options.values&&(this.result.from_value=this.options.values[this.result.from])},"updateTo":function(){this.result.to=this.options.to,this.result.to_percent=this.calcPercent(this.result.to),this.options.values&&(this.result.to_value=this.options.values[this.result.to])},"updateResult":function(){this.result.min=this.options.min,this.result.max=this.options.max,this.updateFrom(),this.updateTo()},"appendGrid":function(){if(this.options.grid){var a,b,c,d,e,f=this.options,g=f.max-f.min,h=f.grid_num,i=0,j=0,k=4,l=0,m="";for(this.calcGridMargin(),f.grid_snap?(h=g/f.step,i=this.toFixed(f.step/(g/100))):i=this.toFixed(100/h),h>4&&(k=3),h>7&&(k=2),h>14&&(k=1),h>28&&(k=0),a=0;h+1>a;a++){for(c=k,j=this.toFixed(i*a),j>100&&(j=100,c-=2,0>c&&(c=0)),this.coords.big[a]=j,d=(j-i*(a-1))/(c+1),b=1;c>=b&&0!==j;b++)l=this.toFixed(j-d*b),m+='<span class="irs-grid-pol small" style="left: '+l+'%"></span>';m+='<span class="irs-grid-pol" style="left: '+j+'%"></span>',e=this.calcReal(j),e=f.values.length?f.p_values[e]:this._prettify(e),m+='<span class="irs-grid-text js-grid-text-'+a+'" style="left: '+j+'%">'+e+"</span>"}this.coords.big_num=Math.ceil(h+1),this.$cache.cont.addClass("irs-with-grid"),this.$cache.grid.html(m),this.cacheGridLabels()}},"cacheGridLabels":function(){var a,b,c=this.coords.big_num;for(b=0;c>b;b++)a=this.$cache.grid.find(".js-grid-text-"+b),this.$cache.grid_labels.push(a);this.calcGridLabels()},"calcGridLabels":function(){var a,b,c=[],d=[],e=this.coords.big_num;
  2. for(a=0;e>a;a++)this.coords.big_w[a]=this.$cache.grid_labels[a].outerWidth(!1),this.coords.big_p[a]=this.toFixed(this.coords.big_w[a]/this.coords.w_rs*100),this.coords.big_x[a]=this.toFixed(this.coords.big_p[a]/2),c[a]=this.toFixed(this.coords.big[a]-this.coords.big_x[a]),d[a]=this.toFixed(c[a]+this.coords.big_p[a]);for(this.options.force_edges&&(c[0]<this.coords.grid_gap&&(c[0]=this.coords.grid_gap,d[0]=this.toFixed(c[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),d[e-1]>100-this.coords.grid_gap&&(d[e-1]=100-this.coords.grid_gap,c[e-1]=this.toFixed(d[e-1]-this.coords.big_p[e-1]),this.coords.big_x[e-1]=this.toFixed(this.coords.big_p[e-1]-this.coords.grid_gap))),this.calcGridCollision(2,c,d),this.calcGridCollision(4,c,d),a=0;e>a;a++)b=this.$cache.grid_labels[a][0],b.style.marginLeft=-this.coords.big_x[a]+"%"},"calcGridCollision":function(a,b,c){var d,e,f,g=this.coords.big_num;for(d=0;g>d&&(e=d+a/2,!(e>=g));d+=a)f=this.$cache.grid_labels[e][0],f.style.visibility=c[d]<=b[e]?"visible":"hidden"},"calcGridMargin":function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},"update":function(b){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.options=a.extend(this.options,b),this.validate(),this.updateResult(b),this.toggleInput(),this.remove(),this.init(!0))},"reset":function(){this.input&&(this.updateResult(),this.update())},"destroy":function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),a.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},a.fn.ionRangeSlider=function(b){return this.each(function(){a.data(this,"ionRangeSlider")||a.data(this,"ionRangeSlider",new k(this,b,e++))})},function(){for(var a=0,b=["ms","moz","webkit","o"],d=0;d<b.length&&!c.requestAnimationFrame;++d)c.requestAnimationFrame=c[b[d]+"RequestAnimationFrame"],c.cancelAnimationFrame=c[b[d]+"CancelAnimationFrame"]||c[b[d]+"CancelRequestAnimationFrame"];c.requestAnimationFrame||(c.requestAnimationFrame=function(b){var d=(new Date).getTime(),e=Math.max(0,16-(d-a)),f=c.setTimeout(function(){b(d+e)},e);return a=d+e,f}),c.cancelAnimationFrame||(c.cancelAnimationFrame=function(a){clearTimeout(a)})}()}(jQuery,document,window,navigator);