PageSourceSearch

https://racer-moto.by/js/bootstrap-touchspin.mine.js

js racer-moto.by collected 2026-10-08 14:28:31 UTC 8,527 bytes, 1 lines download raw bytes

1!function(o){"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof module&&module.exports?module.exports=function(t,n){return void 0===n&&(n="undefined"!=typeof window?require("jquery"):require("jquery")(t)),o(n),n}:o(jQuery)}(function(y){"use strict";var k=0;y.fn.TouchSpin=function(w){var x={min:0,max:100,initval:"",replacementval:"",step:1,decimals:0,stepinterval:100,forcestepdivisibility:"round",stepintervaldelay:500,verticalbuttons:!1,verticalup:"+",verticaldown:"-",verticalupclass:"",verticaldownclass:"",prefix:"",postfix:"",prefix_extraclass:"",postfix_extraclass:"",booster:!0,boostat:10,maxboostedstep:!1,mousewheel:!0,buttondown_class:"btn",buttonup_class:"btn",buttondown_txt:"–",buttonup_txt:"+",callback_before_calculation:function(t){return t},callback_after_calculation:function(t){return t}},_={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",step:"step",decimals:"decimals",stepinterval:"step-interval",verticalbuttons:"vertical-buttons",verticalupclass:"vertical-up-class",verticaldownclass:"vertical-down-class",forcestepdivisibility:"force-step-divisibility",stepintervaldelay:"step-interval-delay",prefix:"prefix",postfix:"postfix",prefix_extraclass:"prefix-extra-class",postfix_extraclass:"postfix-extra-class",booster:"booster",boostat:"boostat",maxboostedstep:"max-boosted-step",mousewheel:"mouse-wheel",buttondown_class:"button-down-class",buttonup_class:"button-up-class",buttondown_txt:"button-down-txt",buttonup_txt:"button-up-txt"};return this.each(function(){var i,s,a,o,t,n,e,u,p=y(this),c=p.data(),r=0,l=!1;function d(){var t,n,o;""!==(t=i.callback_before_calculation(p.val()))?0<i.decimals&&"."===t||(n=parseFloat(t),isNaN(n)&&(n=""!==i.replacementval?i.replacementval:0),(o=n).toString()!==t&&(o=n),null!==i.min&&n<i.min&&(o=i.min),null!==i.max&&n>i.max&&(o=i.max),o=function(t){switch(i.forcestepdivisibility){case"round":return(Math.round(t/i.step)*i.step).toFixed(i.decimals);case"floor":return(Math.floor(t/i.step)*i.step).toFixed(i.decimals);case"ceil":return(Math.ceil(t/i.step)*i.step).toFixed(i.decimals);default:return t}}(o),Number(t).toString()!==o.toString()&&(p.val(o),p.trigger("change"))):""!==i.replacementval&&(p.val(i.replacementval),p.trigger("change"))}function b(){if(i.booster){var t=Math.pow(2,Math.floor(r/i.boostat))*i.step;return i.maxboostedstep&&t>i.maxboostedstep&&(t=i.maxboostedstep,o=Math.round(o/t)*t),Math.max(i.step,t)}return i.step}function h(){d(),o=parseFloat(i.callback_before_calculation(a.input.val())),isNaN(o)&&(o=0);var t=o,n=b();o+=n,null!==i.max&&o>i.max&&(o=i.max,p.trigger("touchspin.on.max"),g()),a.input.val(i.callback_after_calculation(Number(o).toFixed(i.decimals))),t!==o&&p.trigger("change")}function f(){d(),o=parseFloat(i.callback_before_calculation(a.input.val())),isNaN(o)&&(o=0);var t=o,n=b();o-=n,null!==i.min&&o<i.min&&(o=i.min,p.trigger("touchspin.on.min"),g()),a.input.val(i.callback_after_calculation(Number(o).toFixed(i.decimals))),t!==o&&p.trigger("change")}function v(){g(),r=0,l="down",p.trigger("touchspin.on.startspin"),p.trigger("touchspin.on.startdownspin"),e=setTimeout(function(){t=setInterval(function(){r++,f()},i.stepinterval)},i.stepintervaldelay)}function m(){g(),r=0,l="up",p.trigger("touchspin.on.startspin"),p.trigger("touchspin.on.startupspin"),u=setTimeout(function(){n=setInterval(function(){r++,h()},i.stepinterval)},i.stepintervaldelay)}function g(){switch(clearTimeout(e),clearTimeout(u),clearInterval(t),clearInterval(n),l){case"up":p.trigger("touchspin.on.stopupspin"),p.trigger("touchspin.on.stopspin");break;case"down":p.trigger("touchspin.on.stopdownspin"),p.trigger("touchspin.on.stopspin")}r=0,l=!1}!function(){if(p.data("alreadyinitialized"))return;if(p.data("alreadyinitialized",!0),k+=1,p.data("spinnerid",k),!p.is("input"))return console.log("Must be an input.");i=y.extend({},x,c,(e={}
1,y.each(_,function(t,n){var o="bts-"+n;p.is("[data-"+o+"]")&&(e[t]=p.data(o))}),e),w),""!==i.initval&&""===p.val()&&p.val(i.initval),d(),function(){var t=p.val(),n=p.parent();""!==t&&(t=i.callback_after_calculation(Number(t).toFixed(i.decimals)));p.data("initvalue",t).val(t),p.addClass("form-control"),n.hasClass("input-group")?function(t){t.addClass("product-quantity");var n,o,e=p.prev(),a=p.next();e.hasClass("input-group-btn")||e.hasClass("input-group-prepend")?(n='<button class="'+i.buttondown_class+' product-quantity-down product-quantity-injected" type="button">'+i.buttondown_txt+"</button>",e.append(n)):(n='<span class="input-group-btn input-group-prepend product-quantity-injected"><button class="'+i.buttondown_class+' product-quantity-down" type="button">'+i.buttondown_txt+"</button></span>",y(n).insertBefore(p));a.hasClass("input-group-btn")||a.hasClass("input-group-append")?(o='<button class="'+i.buttonup_class+' product-quantity-up product-quantity-injected" type="button">'+i.buttonup_txt+"</button>",a.prepend(o)):(o='<span class="input-group-btn input-group-append product-quantity-injected"><button class="'+i.buttonup_class+' product-quantity-up" type="button">'+i.buttonup_txt+"</button></span>",y(o).insertAfter(p));s=t}(n):(o='<div class="product-quantity product-quantity-injected"><span class="input-group-btn input-group-prepend"><button class="'+i.buttondown_class+' product-quantity-down" type="button">'+i.buttondown_txt+'</button></span><span class="input-group-btn input-group-append"><button class="'+i.buttonup_class+' product-quantity-up" type="button">'+i.buttonup_txt+"</button></span></div>",s=y(o).insertBefore(p),y(".input-group-prepend",s).after(p));var o}(),a={down:y(".product-quantity-down",s),up:y(".product-quantity-up",s),input:y("input",s)},p.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;38===n?("up"!==l&&(h(),m()),t.preventDefault()):40===n&&("down"!==l&&(f(),v()),t.preventDefault())}),p.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;38===n?g():40===n&&g()}),p.on("blur.touchspin",function(){d(),p.val(i.callback_after_calculation(p.val()))}),a.down.on("keydown",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("down"!==l&&(f(),v()),t.preventDefault())}),a.down.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||g()}),a.up.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("up"!==l&&(h(),m()),t.preventDefault())}),a.up.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||g()}),a.down.on("mousedown.touchspin",function(t){a.down.off("touchstart.touchspin"),p.is(":disabled")||(f(),v(),t.preventDefault(),t.stopPropagation())}),a.down.on("touchstart.touchspin",function(t){a.down.off("mousedown.touchspin"),p.is(":disabled")||(f(),v(),t.preventDefault(),t.stopPropagation())}),a.up.on("mousedown.touchspin",function(t){a.up.off("touchstart.touchspin"),p.is(":disabled")||(h(),m(),t.preventDefault(),t.stopPropagation())}),a.up.on("touchstart.touchspin",function(t){a.up.off("mousedown.touchspin"),p.is(":disabled")||(h(),m(),t.preventDefault(),t.stopPropagation())}),a.up.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){l&&(t.stopPropagation(),g())}),a.down.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){l&&(t.stopPropagation(),g())}),a.down.on("mousemove.touchspin touchmove.touchspin",function(t){l&&(t.stopPropagation(),t.preventDefault())}),a.up.on("mousemove.touchspin touchmove.touchspin",function(t){l&&(t.stopPropagation(),t.preventDefault())}),p.on("mousewheel.touchspin DOMMouseScroll.touchspin",function(t){if(i.mousewheel&&p.is(":focus")){var n=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation(),t.preventDefault(),n<0?f():h()}}),p.on("touchspin.destroy",function(){var t;t=p.parent(),g(),p.off(".touchspin"),t.hasClass("product-quantity-injected")?(p.siblings().remove(),p.unwrap()):(y(".product-quantity-injected",t).remove(),t.removeClass("product-quantity")),p.data("alreadyinitialized",!1)}),p.on("touchspin.uponce",function(){g(),h()}),p.on("touchspin.downonce",function(){g(),f()}),p.on("touchspin.startupspin",function(){m()}),p.on("touchspin.startdownspin",function(){v()}),p.on("touchspin.stopspin",function(){g()}),p.on("touchspin.updatesettings",function(t,n){!function(t){var n;n=t,i=y.extend({},i,n),d();var o=a.input.val();""!==o&&(o=Number(i.callback_before_calculation(a.input.val())),a.input.val(i.callback_after_calculation(Number(o).toFixed(i.decimals))))}(n)});var e}()})}});

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.