Файловый менеджер - Редактировать - /home/lmsyaran/public_html/media/com_phocacart/js/touchspin/jquery.bootstrap-touchspin.min.js
Назад
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(n,o){return void 0===o&&(o="undefined"!=typeof window?require("jquery"):require("jquery")(n)),t(o),o}:t(jQuery)}(function(t){"use strict";var n=0;t.fn.TouchSpin=function(o){var s={min:0,max:100,initval:"",replacementval:"",firstclickvalueifempty:null,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 btn-primary",buttonup_class:"btn btn-primary",buttondown_txt:"-",buttonup_txt:"+",callback_before_calculation:function(t){return t},callback_after_calculation:function(t){return t}},p={min:"min",max:"max",initval:"init-val",replacementval:"replacement-val",firstclickvalueifempty:"first-click-value-if-empty",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 a,e,i,u,r,c,l,d,f,b,h=t(this),v=h.data(),x=0,g=!1;function m(){""===a.prefix&&(e=r.prefix.detach()),""===a.postfix&&(i=r.postfix.detach())}function w(){var t,n,o;""!==(t=a.callback_before_calculation(h.val()))?a.decimals>0&&"."===t||(n=parseFloat(t),isNaN(n)&&(n=""!==a.replacementval?a.replacementval:0),o=n,n.toString()!==t&&(o=n),null!==a.min&&n<a.min&&(o=a.min),null!==a.max&&n>a.max&&(o=a.max),o=function(t){switch(a.forcestepdivisibility){case"round":return(Math.round(t/a.step)*a.step).toFixed(a.decimals);case"floor":return(Math.floor(t/a.step)*a.step).toFixed(a.decimals);case"ceil":return(Math.ceil(t/a.step)*a.step).toFixed(a.decimals);default:return t.toFixed(a.decimals)}}(o),Number(t).toString()!==o.toString()&&(h.val(o),h.trigger("change"))):""!==a.replacementval&&(h.val(a.replacementval),h.trigger("change"))}function _(){if(a.booster){var t=Math.pow(2,Math.floor(x/a.boostat))*a.step;return a.maxboostedstep&&t>a.maxboostedstep&&(t=a.maxboostedstep,c=Math.round(c/t)*t),Math.max(a.step,t)}return a.step}function y(){return"number"==typeof a.firstclickvalueifempty?a.firstclickvalueifempty:(a.min+a.max)/2}function k(){w();var t,n=c=parseFloat(a.callback_before_calculation(r.input.val()));isNaN(c)?c=y():(t=_(),c+=t),null!==a.max&&c>a.max&&(c=a.max,h.trigger("touchspin.on.max"),N()),r.input.val(a.callback_after_calculation(Number(c).toFixed(a.decimals))),n!==c&&h.trigger("change")}function C(){w();var t,n=c=parseFloat(a.callback_before_calculation(r.input.val()));isNaN(c)?c=y():(t=_(),c-=t),null!==a.min&&c<a.min&&(c=a.min,h.trigger("touchspin.on.min"),N()),r.input.val(a.callback_after_calculation(Number(c).toFixed(a.decimals))),n!==c&&h.trigger("change")}function j(){N(),x=0,g="down",h.trigger("touchspin.on.startspin"),h.trigger("touchspin.on.startdownspin"),f=setTimeout(function(){l=setInterval(function(){x++,C()},a.stepinterval)},a.stepintervaldelay)}function D(){N(),x=0,g="up",h.trigger("touchspin.on.startspin"),h.trigger("touchspin.on.startupspin"),b=setTimeout(function(){d=setInterval(function(){x++,k()},a.stepinterval)},a.stepintervaldelay)}function N(){switch(clearTimeout(f),clearTimeout(b),clearInterval(l),clearInterval(d),g){case"up":h.trigger("touchspin.on.stopupspin"),h.trigger("touchspin.on.stopspin");break;case"down":h.trigger("touchspin.on.stopdownspin"),h.trigger("touchspin.on.stopspin")}x=0,g=!1}!function(){if(h.data("alreadyinitialized"))return;if(h.data("alreadyinitialized",!0),n+=1,h.data("spinnerid",n),!h.is("input"))return void console.log("Must be an input.");a=t.extend({},s,v,(c={},t.each(p,function(t,n){var o="bts-"+n;h.is("[data-"+o+"]")&&(c[t]=h.data(o))}),c),o),""!==a.initval&&""===h.val()&&h.val(a.initval),w(),function(){var n=h.val(),o=h.parent();""!==n&&(n=a.callback_after_calculation(Number(n).toFixed(a.decimals)));h.data("initvalue",n).val(n),h.addClass("form-control"),o.hasClass("input-group")?function(n){n.addClass("bootstrap-touchspin");var o,s,p=h.prev(),e=h.next(),i='<span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix input-group-prepend bootstrap-touchspin-injected"><span class="input-group-text">'+a.prefix+"</span></span>",r='<span class="input-group-addon input-group-append bootstrap-touchspin-postfix input-group-append bootstrap-touchspin-injected"><span class="input-group-text">'+a.postfix+"</span></span>";p.hasClass("input-group-btn")||p.hasClass("input-group-prepend")?(o='<button class="'+a.buttondown_class+' bootstrap-touchspin-down bootstrap-touchspin-injected" type="button">'+a.buttondown_txt+"</button>",p.append(o)):(o='<span class="input-group-btn input-group-prepend bootstrap-touchspin-injected"><button class="'+a.buttondown_class+' bootstrap-touchspin-down" type="button">'+a.buttondown_txt+"</button></span>",t(o).insertBefore(h));e.hasClass("input-group-btn")||e.hasClass("input-group-append")?(s='<button class="'+a.buttonup_class+' bootstrap-touchspin-up bootstrap-touchspin-injected" type="button">'+a.buttonup_txt+"</button>",e.prepend(s)):(s='<span class="input-group-btn input-group-append bootstrap-touchspin-injected"><button class="'+a.buttonup_class+' bootstrap-touchspin-up" type="button">'+a.buttonup_txt+"</button></span>",t(s).insertAfter(h));t(i).insertBefore(h),t(r).insertAfter(h),u=n}(o):function(){var n,o="";h.hasClass("input-sm")&&(o="input-group-sm");h.hasClass("input-lg")&&(o="input-group-lg");n=a.verticalbuttons?'<div class="input-group '+o+' bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-addon input-group-prepend bootstrap-touchspin-prefix"><span class="input-group-text">'+a.prefix+'</span></span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+a.postfix+'</span></span><span class="input-group-btn-vertical"><button class="'+a.buttondown_class+" bootstrap-touchspin-up "+a.verticalupclass+'" type="button">'+a.verticalup+'</button><button class="'+a.buttonup_class+" bootstrap-touchspin-down "+a.verticaldownclass+'" type="button">'+a.verticaldown+"</button></span></div>":'<div class="input-group bootstrap-touchspin bootstrap-touchspin-injected"><span class="input-group-btn input-group-prepend"><button class="'+a.buttondown_class+' bootstrap-touchspin-down" type="button">'+a.buttondown_txt+'</button></span><span class="input-group-addon bootstrap-touchspin-prefix input-group-prepend"><span class="input-group-text">'+a.prefix+'</span></span><span class="input-group-addon bootstrap-touchspin-postfix input-group-append"><span class="input-group-text">'+a.postfix+'</span></span><span class="input-group-btn input-group-append"><button class="'+a.buttonup_class+' bootstrap-touchspin-up" type="button">'+a.buttonup_txt+"</button></span></div>";u=t(n).insertBefore(h),t(".bootstrap-touchspin-prefix",u).after(h),h.hasClass("input-sm")?u.addClass("input-group-sm"):h.hasClass("input-lg")&&u.addClass("input-group-lg")}()}(),r={down:t(".bootstrap-touchspin-down",u),up:t(".bootstrap-touchspin-up",u),input:t("input",u),prefix:t(".bootstrap-touchspin-prefix",u).addClass(a.prefix_extraclass),postfix:t(".bootstrap-touchspin-postfix",u).addClass(a.postfix_extraclass)},m(),h.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;38===n?("up"!==g&&(k(),D()),t.preventDefault()):40===n&&("down"!==g&&(C(),j()),t.preventDefault())}),h.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;38===n?N():40===n&&N()}),h.on("blur.touchspin",function(){w(),h.val(a.callback_after_calculation(h.val()))}),r.down.on("keydown",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("down"!==g&&(C(),j()),t.preventDefault())}),r.down.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||N()}),r.up.on("keydown.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||("up"!==g&&(k(),D()),t.preventDefault())}),r.up.on("keyup.touchspin",function(t){var n=t.keyCode||t.which;32!==n&&13!==n||N()}),r.down.on("mousedown.touchspin",function(t){r.down.off("touchstart.touchspin"),h.is(":disabled")||(C(),j(),t.preventDefault(),t.stopPropagation())}),r.down.on("touchstart.touchspin",function(t){r.down.off("mousedown.touchspin"),h.is(":disabled")||(C(),j(),t.preventDefault(),t.stopPropagation())}),r.up.on("mousedown.touchspin",function(t){r.up.off("touchstart.touchspin"),h.is(":disabled")||(k(),D(),t.preventDefault(),t.stopPropagation())}),r.up.on("touchstart.touchspin",function(t){r.up.off("mousedown.touchspin"),h.is(":disabled")||(k(),D(),t.preventDefault(),t.stopPropagation())}),r.up.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){g&&(t.stopPropagation(),N())}),r.down.on("mouseup.touchspin mouseout.touchspin touchleave.touchspin touchend.touchspin touchcancel.touchspin",function(t){g&&(t.stopPropagation(),N())}),r.down.on("mousemove.touchspin touchmove.touchspin",function(t){g&&(t.stopPropagation(),t.preventDefault())}),r.up.on("mousemove.touchspin touchmove.touchspin",function(t){g&&(t.stopPropagation(),t.preventDefault())}),h.on("mousewheel.touchspin DOMMouseScroll.touchspin",function(t){if(a.mousewheel&&h.is(":focus")){var n=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;t.stopPropagation(),t.preventDefault(),n<0?C():k()}}),h.on("touchspin.destroy",function(){var n;n=h.parent(),N(),h.off(".touchspin"),n.hasClass("bootstrap-touchspin-injected")?(h.siblings().remove(),h.unwrap()):(t(".bootstrap-touchspin-injected",n).remove(),n.removeClass("bootstrap-touchspin")),h.data("alreadyinitialized",!1)}),h.on("touchspin.uponce",function(){N(),k()}),h.on("touchspin.downonce",function(){N(),C()}),h.on("touchspin.startupspin",function(){D()}),h.on("touchspin.startdownspin",function(){j()}),h.on("touchspin.stopspin",function(){N()}),h.on("touchspin.updatesettings",function(n,o){!function(n){(function(n){if(a=t.extend({},a,n),n.postfix){var o=h.parent().find(".bootstrap-touchspin-postfix");0===o.length&&i.insertAfter(h),h.parent().find(".bootstrap-touchspin-postfix .input-group-text").text(n.postfix)}if(n.prefix){var s=h.parent().find(".bootstrap-touchspin-prefix");0===s.length&&e.insertBefore(h),h.parent().find(".bootstrap-touchspin-prefix .input-group-text").text(n.prefix)}m()})(n),w();var o=r.input.val();""!==o&&(o=Number(a.callback_before_calculation(r.input.val())),r.input.val(a.callback_after_calculation(Number(o).toFixed(a.decimals))))}(o)});var c}()})}});
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка